Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITextView contentInset not working in UITextView on iOS 7?

I'm trying to set a UITextView's contentInset property. When doing so, the UIEdgeInset's top variable works just fine. So [self.textView setContentInset: 'UIEdgeInsetsMake(50, 0, 0, 0)]; works.

But assigning any other variable of UIEdgeInsets doesn't work. Only the top adjusts. bottom doesn't adjust, neither do left or right.

So [self.textView setContentInset: UIEdgeInsetsMake(0, 50, 100, 50)]; doesn't do anything to my textView.

Am I missing something? Any ideas?

like image 731
Joe Avatar asked Oct 05 '13 22:10

Joe


Video Answer


1 Answers

Use setTextContainerInset instead of contentInset on iOS 7.

[self.textView  setTextContainerInset:UIEdgeInsetsMake(0, 50, 100, 50)];
like image 139
Oran Dennison Avatar answered Sep 30 '22 20:09

Oran Dennison