如标题所述,我正在尝试为UITextView添加类似于padding的行为。当视图被推入我的导航控制器时生成文本视图,并出现以下代码:
self.textView.layer.cornerRadius = 7;
//pretty stuff is pretty
NSString *description = appDelegate.productInDisplay.description;
[self.textView setText:description];
//pretty stuff has content now
CGRect frame = textView.frame;
frame.size.height = textView.contentSize.height;
textView.frame = frame;
//set the UITextView to the size of it's containing text.
self.textView.editable = NO;
self.theScrollView.contentSize = CGSizeMake(320, 250 + textView.frame.size.height);
//set the parent scrollView's height to fit some other elements with fixed size (250)
//and the pre-mentioned UITextView
所以,一切都正常工作,但是我想在UITextView的所有四个边缘上添加一些填充,并且在谷歌搜索了三个小时后,我无法做到这一点,尽管这似乎相当容易。有什么建议吗?