UIScrollView content is offset after pushing and popping another view controller
| Originator: | steven.oglesby | ||
| Number: | rdar://14342039 | Date Originated: | |
| Status: | Closed | Resolved: | iOS7 beta 2 |
| Product: | iPhone SDK | Product Version: | 6.1.3 |
| Classification: | UI | Reproducible: | Yes |
Summary: Set up a UIScrollView using autolayout. Content size is calculated automatically based on the contents. If you push and then pop a view controller when the scroll view has an offset then you can no longer scroll to see all the contents. Steps to Reproduce: See attached XCode project. UINavigationController with root view controller that contains UIScrollView. There are two buttons that will push to a new view controller. If you use the top button (with scroll view contents not scrolled) and then pop the view controller then everything is OK. If you use the bottom button (with scroll view contents scrolled) and then pop the view controller then it is no longer possible to view the whole contents. Expected Results: Scroll view scrolls to all of content Actual Results: Scroll view does not allow you to see all of contents Regression: Notes: The contentSize for the scroll view is calculated the same. It appears that there is something a bit like a contentInset being applied that is half the distance of the contentOffset when you push to the child view controller. If you cache the contentOffset before pushing and then apply it back in viewDidAppear then everything works OK. Applying the cached value back in viewWillAppear does not fix the problem. -------------------------------------------- Fixed in iOS 7 beta 2
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!