tableview动态cell高度动态label高度

        self.tableView.estimatedRowHeight = 44.0
        self.tableView.rowHeight = UITableView.automaticDimension

设置表格动态高度

storyboard中设置label的lines为0

storyboard中设置自动布局top,left,right,bottom 重点不需要设置高度,因为高度会自动计算出来,这时候在storyboard中看起来有点怪,没关系的。

猜你喜欢

转载自www.cnblogs.com/iaoc/p/10232267.html