(Warning, I'm an iOS newbie.) I have created a custom Table View Cell and have registered it, and implemented it, on two seperate Table View Controllers. When I run the app the custom xib content is truncated by the parent Table Cell View height.
I'd like for each Table View to dynamically determine its height based on the height of the content in the custom Table View Cell xib.
I have tried adding
myTableView.rowHeight = UITableViewAutomaticDimension
myTableView.estimatedRowHeight = 160.0
to one of the Table View Controller's viewDidLoad function, but no luck.
Make sure you have set constraints within your tableview cell that will force it to expand to the height you want.
In particular, make sure you have vertical constraints between the top of the cell and "Hello", between "Hello" and "Language", and between "Language" and the bottom of the cell.
If this doesn't work, you might try doing this in a prototype cell within one of your table view controllers, just to see if perhaps there is an issue using xibs for dynamic cells.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With