I have a search and search on endless blogs and articles on how to determine the dynamic height for a custom UITableViewCell and its long text. It was really hard for me to find good documentation about this.
I need to make the cell grow in accordance with the text inside, but never fall below a height of 70.
I tried several answers to this question here on StackOverflow, but none of them worked. My application is completely finished, but I really need to achieve this before I release it, and its troublesome.
This is what I am trying, but I just get a detachment of cells overlapping each other. From what I read, I need to find the frame if the custom cell or text view is in the cell, but I'm not sure how to do this or mix everything together to return the same height.
Any help would be greatly appreciated Thank you!
- (CGFloat) tableView: (UITableView *) tableView heightForRowAtIndexPath: (NSIndexPath *) indexPath { CGSize aSize; aSize = [[(Tweet*)[tweets objectAtIndex:indexPath.row]tweet] sizeWithFont:[UIFont systemFontOfSize:14] constrainedToSize:CGSizeMake(300.0, 1000.0) lineBreakMode:UILineBreakModeTailTruncation]; return aSize.height; }
Freeappl3
source share