-[UIScrollView scrollToVisibleRect:animated:] works incorrectly when scrollview is zooming and has an huge inset

Originator:pitiphong.ph
Number:rdar://22736445 Date Originated:17/09/2015
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 8.4&9
Classification:Bug Reproducible:Always
 
I have a UIScrollView which has contentSize equal to its main content view size and I also set its contentInset with a big padding (eg. (50, 1200, 40, 900)) and add supplementary views in those padding area
The scroll view also be able to zoom its main content and supplementary views have the text field/textview in them
When one of those text view becomes first responder, I update its inset for avoiding keyboard and call -[UIScrollView scrollToVisibleRect:animated:] to bring that text view visible in screen. Here come the problem, -[UIScrollView scrollToVisibleRect:animated:] method works incorrectly and I can't figure its misbehavior. In my main project, I have inset.left to be 1200 and supplementary view's x origin to be -1150, when I called -[UIScrollView scrollToVisibleRect:animated:], Scroll view bounds X origin will be -2350 but its content inset is -1175 which is weird.

I try to reproduce the above behavior in sample project but I can't. Although -[UIScrollView scrollToVisibleRect:animated:] still misbehavior.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!