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
Remember that for iOS 7 there a special property called
textContainerInset The inset of the text container's layout area within the text view's content area.
@property(nonatomic, assign) UIEdgeInsets textContainerInset
This property provides text margins for text laid out in the text view.
Availability Available in iOS 7.0 and later. Declared In UITextView.h
in iOS 6 the contentInset is doing the job. I personally encountered this problem. Everything ended up with:
if (isIOS7()) {
textView.textContainerInset = UIEdgeInsetsMake(0, 10, 0, 10);
} else {
textView.contentInset = UIEdgeInsetsMake(0, 10, 0, 10);
}