-1
我想動態更改所選行的高度。表視圖行高不適用於iOS
該文檔說heightForRowAtIndexPath:
是這樣做的最佳方式。
我到目前爲止在這裏。檢測水龍頭,但該行的高度不會改變:
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
func tableView(tableView: UITableView, heightForRowAt: IndexPath) -> CGFloat {
return 490.0
}
// print("helloworld")
}
不要把heightForRow *放在* didSelectRow裏面。將它放在符合表視圖委託的對象上並重新加載didSelectRow上的表。 – JAL