I use the following code to determine the height needed for UITextViewwhich is added to UITableViewCell, as well as to determine the height for each UITableViewCell.
This works 90% of the time, but some incoming data (always the same incoming data) ends. If I enable scrolling in UITextView, I see that all the text is in UITextView, but UITextViewdoes not have enough height to display all the text.
There seems to be something wrong with the text being read, no special or hidden characters, etc.
UIFont *font = [UIFont fontWithName:@"ArialMT" size:14];
CGSize withinSize = CGSizeMake(230, 10000);
CGSize size = [currentTimelineText sizeWithFont:font constrainedToSize:withinSize lineBreakMode:UILineBreakModeWordWrap];
When I create a frame with frame = CGRectMake(boundsX, yPosition, 230, size.height);and assign frame UITextView, it (sometimes) becomes short.
source
share