2017-01-08 51 views

回答

1

看看伟大的教程: https://www.raywenderlich.com/129059/self-sizing-table-view-cells 其用于自动布局路。但代表方法

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 
    //code 
} 

更加优选,因为它的实际速度更快。看看这里:https://medium.com/ios-os-x-development/perfect-smooth-scrolling-in-uitableviews-fd609d5275a5#.i439tyds6

+0

非常感谢!回答在SOF真棒 - http://stackoverflow.com/questions/18746929/using-auto-layout-in-uitableview-for-dynamic-cell-layouts-variable-row-heights/18746930#18746930 – zzheads