I\'m working on an application where I have a custom subclass of UITableViewCell. I want to make the cell\'s height dynamic based on the text inside it. I try do do that in
I had a similar problem and came across, just to share what I do now which works well for me
CGFloat mycell_height;
- (void)viewDidLoad
{
[super viewDidLoad];
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@"MyCell"];
mycell_height = cell.frame.size.height;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return mycell_height; //assuming all cells are the same
}
Hope this helps anyone looking for this and new to iOS programming like me :-)