ios swift5 tableView禁止滚动 tableView的高度等于内容(所有cell)的高度

1.禁止滚动

tableView.isScrollEnabled = false

iOS UITableView 禁止滑动

2.tableView的高度等于内容(所有cell)的高度

3.如果cell的高度会根据内容变化,那边就不能用tableView.estimatedRowHeight来自动行高,需要提前手动算出cell的高度

ios swift5 UIlabel 根据文字(内容)计算高度 宽度确定,高度自适应,但要提前知道高度 boundingRectWithSize

iOS开发 | 简单实在的cell高度自适应内容及提前计算并缓存cell高度

猜你喜欢

转载自blog.csdn.net/baidu_40537062/article/details/123907910