I have an autoscroll feature in my app. When it's activated, my code disables textView scroll and changes contentOffset using CADisplayLink.
Works fine in earlier versions of iOS, but in 7th text appears cropped.
While discovered further I've found that contentSize being changed some time after I disable scroll of textView. Looks like it some kind of optimization. But it don't take contentOffset into account.
To reproduce this bug:
- Make sure text in textView is large enough, at least two pages in size.
- In ViewController put
_textView.scrollEnabled = NO;into-viewDidLoad In ViewController add:
- (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [_textView setContentOffset:CGPointMake(0, 400) animated:YES]; }
The question is: how to autoscroll UITextView in iOS7 while scrollEnabled set to NO?
Scroll is disabled to stop possible UITextView built-in autoscroll on caret position change and to disallow user interaction with control.