Lokesh Basu
Lokesh Basu

Reputation: 31

Can we have XIB for UITableViewCell with dynamic height?

I'm trying to create a TableView with custom TableView cell with multiple XIB one for Image, other for Text + Video. But the height has to be predefined for the XIB in the interface.

So how can I have an XIB for my UITableViewCell with dynamic height?

Upvotes: 1

Views: 714

Answers (1)

thy.nguyen
thy.nguyen

Reputation: 130

Try this in your viewDidLoad:

yourTableView.estimatedRowHeight = yourTableViewCellHeight yourTableView.rowHeight = UITableViewAutomaticDimension

Upvotes: 3

Related Questions