qwertydev qwertydev - 6 months ago 12
Swift Question

Dynamic height of UITableview Issue

I have set

self.tableView.estimatedRowHeight = 88.0
self.tableView.rowHeight = UITableViewAutomaticDimension


Also I have done numberOfLines of
UILabel
to zero.
I haven't given any fixed height/width constraint in IB.
Still my UITableviewCell height is not expanded accordingly.

Please suggest me what to do.

Answer

Check whether you are explicitly defining tableView:heightForRowAtIndexPath method. If so remove that method or if you want to use it because of several cells existing there , you can return UITableViewAutomaticDimension for that particular cell height.

Comments