I try to get the fitting height for a UITextView
with this code:
[textView sizeThatFits:CGSizeMake(textView.frame.size.width, FLT_MAX)].height;
It returns the correct value most of the time, but sometimes it returns a value that is one line more or less than the correct height value.
Here is an example when it is correct:
...and here is another when it's wrong (the full text is "California (There Is No End to Love)")
How can I fix this?
Using a UILabel
instead of a UITextView
solved my problem.