The only answer that comes to mind is to independently develop the content. Use NSString to determine the size of the window directly above the desired text (it can be difficult if the text should not start with a line, you may need to try several ranges to find one that makes the height jump). This should give you the content needed for a UIScrollView . I'm a little worried about performance, and it may be necessary to create your own implementation of UITextView in order to be effective (which should not be so difficult if it's static content). -sizeWithFont:forWidth:lineBreakMode: sizeWithFont:constrainedToSize:lineBreakMode:-setContentOffset:animated:
This is not as elegant as we would like, but UITextView does not give you much access to the layout engine.
source
share