Anthony Anthony - 1 year ago 81
iOS Question

swift 3 - dynamic cells size issue

i'm trying to create a table with many dynamic cells prototype
i'm using the 2 lines of codes in the viewDidLoad()

Table.estimatedRowHeight = 171;
Table.rowHeight = UITableViewAutomaticDimension

however, when the cells need to be higher than 171, it stays 171, until i scroll down and up my tableview, then every cell takes it own really height

so what is the really problem ?

Answer Source

The code is correct, the location is not.

You should not be giving it in viewDidLoad but rather heightForRowAtIndexPath

Try that, it should work. Cheers!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download