我正在尝试设置UITextView
的{{1}}属性。这样做时,contentInset
的{{1}}变量就可以了。所以UIEdgeInset
有效。
但是分配UIEdgeInsets的任何其他变量都不起作用。只有top
会调整。 [self.textView setContentInset: 'UIEdgeInsetsMake(50, 0, 0, 0)];
无法调整top
或bottom
。
所以left
对我的textView没有任何作用。
我错过了什么吗?有什么想法吗?
答案 0 :(得分:13)
在iOS 7上使用setTextContainerInset而不是contentInset。
[self.textView setTextContainerInset:UIEdgeInsetsMake(0, 50, 100, 50)];