6

我正在尝试设置 aUITextViewcontentInset属性。这样做时,UIEdgeInset'stop变量可以正常工作。所以[self.textView setContentInset: 'UIEdgeInsetsMake(50, 0, 0, 0)];有效。

但是分配 UIEdgeInsets 的任何其他变量都不起作用。只有top调整。bottom不调整,也不做leftright

所以[self.textView setContentInset: UIEdgeInsetsMake(0, 50, 100, 50)];对我的 textView 没有任何作用。

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

4

1 回答 1

13

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

[self.textView  setTextContainerInset:UIEdgeInsetsMake(0, 50, 100, 50)];
于 2013-10-22T21:30:14.980 回答