I\'m trying to add a left margin to a UITextView.
I\'ve tried setting the property contentInset, see below:
UITextView *textView = [[UITextView alloc] in
UITextView
is internally implemented using a web view. These internals uses allot of undocumented tricks, that also changes between OS updates. One of these tricks is to time and again reset the contentInsets
property. When and why is not documented, by I have learned that any changes to the layout of the text view can/will trigger this reset.
My first advice would be to not try to tweak the insets of the text view. It is just to fragile, and will probably break in the future.
If you really insist anyway then I would subclass UITextView
, override -[UITextView layoutSubviews]
and force new insets there.
In either case I would go to http://bugreport.apple.com and report the current behavior as serious bug.