UITextView contentInset在iOS 7上的UITextView中不起作用?

时间:2013-10-05 22:41:10

标签: ios ios7 uitextview uiedgeinsets

我正在尝试设置UITextView的{​​{1}}属性。这样做时,contentInset的{​​{1}}变量就可以了。所以UIEdgeInset有效。

但是分配UIEdgeInsets的任何其他变量都不起作用。只有top会调整。 [self.textView setContentInset: 'UIEdgeInsetsMake(50, 0, 0, 0)];无法调整topbottom

所以left对我的textView没有任何作用。

我错过了什么吗?有什么想法吗?

1 个答案:

答案 0 :(得分:13)

在iOS 7上使用setTextContainerInset而不是contentInset。

[self.textView  setTextContainerInset:UIEdgeInsetsMake(0, 50, 100, 50)];