I have a UITextView which I would like to dynamically resize dependant on its content.
For some reason the textview is always shorter that its contents! Here's the code:
_textView.text = [NSString stringWithFormat:@"Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test "];
CGRect frame = _textView.frame;
frame.size.height = _textView.contentSize.height;
_textView.frame = frame;
And here's the result:
As you can see the UITextView (in white) is too short. If I put more or less contents in there the shortness is the same, i.e.
I'm sure it's something simple but I can't work it out.