UITableViewAutomaticDimension not working in Xcode 6.3

前端 未结 2 1874
误落风尘
误落风尘 2021-02-12 22:08

I updated my Xcode to 6.3 along with Swift 1.2, and I made the transition.

Everything works except dynamic row height for table view. I have those on 3 completely differ

2条回答
  •  感情败类
    2021-02-12 22:22

    Estimated row height needs to be provided.

    It is better not to implement estimatedHeightForRowAtIndexPath: unless necessary.

    estimatedRowHeight is cheaper provided you can come up with a value

        tableView.rowHeight = UITableViewAutomaticDimension
        tableView.estimatedRowHeight = 30 //Provide any appropriate value
    

提交回复
热议问题