Swift设置自动行高

1         // 设置行高自适应
2         tableView.rowHeight = UITableViewAutomaticDimension
3         
4         // 设置预估行高
5         tableView.estimatedRowHeight = 200
 1         // 底部的toolBar
 2         toolBar.snp_makeConstraints { (make) in
 3             make.top.equalTo(originalView.snp_bottom)
 4             make.leading.trailing.equalTo(originalView)
 5             make.height.equalTo(35)
 6             
 7             // 关键约束
 8             make.bottom.equalTo(contentView.snp_bottom)
 9         }
10         
11         // 要麽全部指定,要麽全部不指定
12         contentView.snp_makeConstraints { (make) in
13             make.top.left.right.bottom.equalTo(self)
14         }
原文地址:https://www.cnblogs.com/panda1024/p/6181686.html