UIPageViewController auto layout behave erratically under translucent UINavigationBar or UIToolbar
| Originator: | craig.hockenberry | ||
| Number: | rdar://20436297 | Date Originated: | 06-Apr-2015 11:32 AM |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 8.2 (12D508) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: When a UIPageViewController’s edges extend under a translucent navigation bar or toolbar, there is visible jumping as views appear on screen. This jumping is caused by the top and bottom layout guides moving. Steps to Reproduce: 1) Build and run the attached project (JumpingRadar.zip) Expected Results: The views should appear on screen without any content shifting after it appears. Actual Results: Both the “Bunny Rabbits” and “Van Halen” jump. Regression: N/A Notes: The only workaround (labelled “WORKAROUND” in the sample project’s ViewController.m) is to prevent the page view controllers edges from extending below a UINavigationBar (UIRectEdgeTop) or UIToolbar (UIRectEdgeBottom). Other Observations: 1) If you make the transitionStyle in the storyboard UIPageViewControllerTransitionStylePageCurl (change the Transition Style for the view controller in the storyboard's "Jumping Scene"). When the edges extend under the translucent elements, the jumps happen as you move from the current page to the previous page. Note that these jumps start at a different vertical position than the jumps with UIPageViewControllerTransitionStyleScroll. 2) This sample doesn't use a toolbar in the navigation controller, but if you turn it on, you'll see some more strange behavior: the bottom label jumps by the height difference of the toolbar and the page view control. 3) If you have access to the entire view hierarchy, you can beat things into submission by using the parent view controller: http://stackoverflow.com/a/21541533/132867 With a view controller that's running as an extension, this is not an option since the part of the view hierarchy you need is inaccessible via XPC. 4) You can't work around this problem by using a parent-child view controller hierarchy. I tried embedding the UIPageViewController inside a regular UIViewController thinking it might allow the layout guides to be established before the page views are presented. But the same behavior is present: it appears that you just can't have a UIPageViewController any time there's a translucent UINavigationBar or UIToolbar in the hierarchy. Again, that sucks when a view controller running in an extension has no control over its host's view hierarchy. ---- Another note: Using the top of the view as a layout constraint isn't a viable option since orientation changes can alter the height of the translucent navigational elements. ---- http://files.iconfactory.net/craig/bugs/JumpingRadar.zip
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!