user1960970
user1960970

Reputation: 157

TableView in TableViewCell with auto height

enter image description here

I have a cell like this

The inside tableView is not scroll enable, but has dynamic cells, and dynamic contentSize

The tableView's height depends on cells

When I use UITableViewAutomaticDimension to auto size for the cell,

contentTableView.rowHeight = UITableViewAutomaticDimension

it's not working for the inside tableView

it just show Labels of the cell, but not tableView

Any Answers? Thanks

Upvotes: 2

Views: 982

Answers (1)

Dheeraj D
Dheeraj D

Reputation: 4451

First Write this in viewDidLoad

self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = 44.0;

Set numberOfLine property to 0 in StoryBord

Set UILable autolayout to Leading Trailing Top Bottom from SuperView

Hope it will work...

For Detail Description Refer this Answer

Upvotes: 0

Related Questions