xcode - Custom UITextView scroll size -


I have a UITextView, and I insert multi text with many images. When I scroll, this is the first interval of the first scroll. I found it to guess the scroll size incorrectly. For example, when the size of the UITextView content is loaded to the string 2534, but when I scroll it down it changes to 7439. I have a method that predicts the size of the content, but when I do not set it:

  Self TextView.contentSize.height = 7439  

But this is not effective! How can I write a custom class derived from UITQView which handles the content size with my custom function?

T why do I know but I have found this:

  Self.textView.layoutManager.allowsNonContiguousLayout = false  

This will solve the problem!


Comments