需要三个设置配合使用才起作用:
1. 控制器中的wiewDidLoad()方法里面加入:
tableView.estimatedRowHeight= 36
tableView.rowHeight=UITableViewAutomaticDimension
2. 画板中设置单元行的约束,顶距和底距都设置为0
3. 选择会产生多行的那个值,设置默认行数为0
需要三个设置配合使用才起作用:
1. 控制器中的wiewDidLoad()方法里面加入:
tableView.estimatedRowHeight= 36
tableView.rowHeight=UITableViewAutomaticDimension
2. 画板中设置单元行的约束,顶距和底距都设置为0
3. 选择会产生多行的那个值,设置默认行数为0
本文标题:TableView自动换行设置
本文链接:https://www.haomeiwen.com/subject/aouwmttx.html
网友评论