From 0d989121b710c60422c7adb2694c5236216e0a6b Mon Sep 17 00:00:00 2001 From: RyanKim01 Date: Mon, 11 Jan 2016 13:20:18 -0800 Subject: [PATCH] Made cell height in popover dynamic --- Source/Cells/Popover/FORMFieldValuesTableViewController.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Cells/Popover/FORMFieldValuesTableViewController.m b/Source/Cells/Popover/FORMFieldValuesTableViewController.m index 5e22cf1b..6d71f9ba 100755 --- a/Source/Cells/Popover/FORMFieldValuesTableViewController.m +++ b/Source/Cells/Popover/FORMFieldValuesTableViewController.m @@ -40,7 +40,8 @@ - (void)viewDidLoad { self.clearsSelectionOnViewWillAppear = NO; - self.tableView.rowHeight = FORMFieldValuesCellHeight; + //Make the rowheight estimated to make the height dynamic + self.tableView.estimatedRowHeight = FORMFieldValuesCellHeight; [self.tableView registerClass:[FORMFieldValueCell class] forCellReuseIdentifier:FORMFieldValueCellIdentifer]; [self.tableView registerClass:[FORMFieldValuesTableViewHeader class] forHeaderFooterViewReuseIdentifier:FORMFieldValuesTableViewHeaderIdentifier]; @@ -89,6 +90,9 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N FORMFieldValue *fieldValue = self.values[indexPath.row]; cell.fieldValue = fieldValue; + // By setting the number of lines to 0, we tell the label to resize automatically + cell.textLabel.numberOfLines = 0; + if ([self.field.value isKindOfClass:[FORMFieldValue class]]) { FORMFieldValue *currentFieldValue = self.field.value;