3

We have a UITextView, with line height of 21 points. When displaying it using the calculated size (i.e. - its "contentSize") - we get a field that is too high (37 points). Trying to force a different contentSize causes the text to be partly visible, as if there is a margin of 8 points from the top. Is there a way to reduce this margin, and cause the UITextView to position the text at the top of the field? Thanks

user964797
  • 231
  • 3
  • 6
  • Use `self.automaticallyAdjustsScrollViewInsets = false` for the view controller. See [this question](http://stackoverflow.com/questions/18931934/blank-space-at-top-of-uitextview-in-ios-7). – Suragch Mar 11 '16 at 13:44

1 Answers1

0

[YourTextView setContentOffset:CGPointZero];

Try this... Hope it helps

Hemang
  • 26,840
  • 19
  • 119
  • 186
lakshmen
  • 28,346
  • 66
  • 178
  • 276