美文网首页
TableView自动换行设置

TableView自动换行设置

作者: sosocom | 来源:发表于2016-12-15 01:10 被阅读106次

    需要三个设置配合使用才起作用:

    1. 控制器中的wiewDidLoad()方法里面加入:

    tableView.estimatedRowHeight= 36

    tableView.rowHeight=UITableViewAutomaticDimension

    2. 画板中设置单元行的约束,顶距和底距都设置为0

    3. 选择会产生多行的那个值,设置默认行数为0

    相关文章

      网友评论

          本文标题:TableView自动换行设置

          本文链接:https://www.haomeiwen.com/subject/aouwmttx.html