我有一个UILabel和UITextView添加到UIViewController的视图中,如下面的屏幕截图所示。
当我键入一些单词并且uitextview开始滚动时,它与标签的标题重叠,如下所示。
我试图设置textView的textContainerInset,但是没有按预期工作。它在正常位置下方10pt处开始显示文本,但在滚动时仍然重叠。
textView.textContainerInset = UIEdgeInsetsMake(10, 0, 0, 0);
最佳答案
看来您已经将TextView放在UILabel上了。向上移动UILabel或向下移动TextView,希望可以解决该问题。
CGRect frame = theLabel.frame;
frame.origin.y = frame.origin.y - 20;
theLabel.frame= frame;
这会将标签向上移动20px。
希望这可以帮助... :)
关于ios - 滚动时的TextView文字重叠,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/27262363/