As far as I know, the only way to set the table cell height is with the delegate method heightForRowAtIndexPath :. To call this method, you can call reloadData in the table, but I'm not sure what effect it will have on the UITextView you are editing. However, it is worth a try.
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 100;
}
To calculate the return value, you will need to work out the height based on the current input and at the same time expand the text view. NSString has some useful methods for this, such as sizeWithFont: constrainedToSize: lineBreakMode :. He will develop CGSize, which you can use to create CGRect, etc.
source
share