I have a UITableView that has five static cells. I need the cell height of one cell to adjust automatically to its contents, which is one UILabel.
Is there any way I
For iOS 8, I found out that you cannot do the same strategy as for Dynamic Table View Cell.
To automatically adjust the height of static cells, I implement these two UITableViewDelegate methods:
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewAutomaticDimension;
}
-(CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 44;
}
Hope it helps.