2017-01-08 79 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