views:

163

answers:

1

I am creating an app which will have a question in a UILabel and a multiple choice answers displayed in UITableView, each row showing a multiple choice. Questions and answers will vary, so I need this UITableView to be dynamic in height.

I would like to find a "sizeToFit" work around for the table. Where the table's frame is set to the height of all it's content.

Can anyone advise on how I can achieve this? Thank you.

+1  A: 

Actually found the answer my self.

I just create a new CGRect for the table.frame with the height of table.contentSize.height

That sets the height of the UITableView to the height of its content.

MiMo81
if this is the answer, mark it as the answer
prendio2