【发布时间】:2011-11-28 07:18:54
【问题描述】:
我有一个 UITextView,里面有一些文字。问题是文本滚动到 UITextView 框的边界之外。 (UITextView 不可编辑。)
这是代码以及我尝试解决此问题的方法:
- (void)viewDidLoad {
textBG.contentInset = UIEdgeInsetsZero;
// textBG.layer.masksToBounds = NO;
textBG.layer.cornerRadius = 10.0;
textBG.layer.borderWidth = 0.0;
[textBG setClipsToBounds:YES];
[super viewDidLoad];
}
- (void)textViewDidBeginEditing:(UITextView*)textView
{
textBG.contentInset = UIEdgeInsetsZero;
[textBG setClipsToBounds:YES];
}
- (void) shouldChangeTextInRange:(UITextView*)textView {
textBG.contentInset = UIEdgeInsetsZero;
[textBG setClipsToBounds:YES];
}
感谢您的帮助
【问题讨论】:
-
"text scrolls outside of the boundaries"是什么意思? -
我添加了问题截图。
标签: iphone objective-c ios uitextview