How to auto resize a cell in tableview based on user input. So that if user inputs a lot of words the cell expands in order so label could expand and all the text could wrap and fit.
Sort of exactly how it is done in iPhone reminder application.
How to auto resize a cell in tableview based on user input. So that if user inputs a lot of words the cell expands in order so label could expand and all the text could wrap and fit.
Sort of exactly how it is done in iPhone reminder application.
I think what you need is this -
tableView.estimatedRowHeight = 100
//You can put anything in place of 100.
tableView.rowHeight = UITableViewAutomaticDimension
Hope this helps
Basic implementation is to add constraints on all four side i.e. top, bottom, leading and trailing.
and in viewDidLoad(), setTableViewHeight to UITableViewAutomaticDimension
- (void)viewDidLoad
{
...
...
self.tableView.estimatedRowHeight = 50.0;
self.tableView.rowHeight = UITableViewAutomaticDimension;
/*To hide separator from empty space at bottom*/
[[self tableView] setTableFooterView:[UIView new]];
}
Follow this nice tutorial, and you will be able to implement the required in no time