快速的問題:我有一個UITableViewController
,一般設置工作正常。 我只是試圖微調間距。UITableViewController estimatedRowHeight with detailTextLabel
在UITableViewController
的viewDidLoad
我打電話:
tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 60
我的一些默認細胞的使用detailTextLabel
(style: .subtitle
)和一些不(style: .default
)。 當他們這樣做時,單元格似乎不會調整行高度。 文字看起來很緊張,特別是當detailTextLabel
是兩行時。
我想避免必須重寫tableView:heightForRowAtIndexPath:
函數? 有沒有一招?
謝謝
發生了什麼事情的快速屏幕? :) –
而不是使用height屬性方法嘗試與高度委託方法相同。 Bcz委託方法調用每個單元格,因此可以爲每個單元格設置不同的高度。 –
使用約束。和委託方法。 –