UITextView的一个bug


最近在重构公司APP用的debugView

发现UITextView的editable属性设置为NO时

使用scrollRangeToVisible方法会改变textContainer的区域

解决办法是将UITextView的layoutManager属性的allowsNonContiguousLayout设置为NO

textView.layoutManager.allowsNonContiguousLayout = NO;