1

I'm trying to fit 3 lines of text in a textview of a certain size by using

[_messageField setContentInset:UIEdgeInsetsMake(-8, -6, 0,0)];

This works in iOS 6, but iOS 7 seems to be clipping content at the bottom of the textview. Both of the textviews shown below have the same font, text, and edge insets. Line 3 does not appear in iOS 7.

enter image description here

enter image description here

davis
  • 1,911
  • 6
  • 26
  • 50

2 Answers2

3

I had success using

[_messageField setTextContainerInset:UIEdgeInsetsMake(0, 0, 0, 0)];

and adjusting as needed.

davis
  • 1,911
  • 6
  • 26
  • 50
  • That's interesting. I'm beginning to question the usefulness of UIScrollView methods when dealing with a UITextView that's backed by Text Kit. – bilobatum Jan 07 '14 at 00:58
0

This solved the issue I was having.

self.textView.contentInset = UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f);
self.textView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0);
Fabio Antunes
  • 22,251
  • 15
  • 81
  • 96
Bob
  • 11
  • 4