Large-title UINavigationBar doesn't collapse on scrolling
Originator: | tzahola | ||
Number: | rdar://34611901 | Date Originated: | 2017-09-23 |
Status: | Open | Resolved: | Not |
Product: | iOS | Product Version: | 11 |
Classification: | bug | Reproducible: | always |
Area: UIKit Summary: A UINavigationController with large titles won't collapse on scrolling the underlying scroll view. Steps to Reproduce: Here's a sample project: https://github.com/tzahola/iOS-11-Large-Title-Navigation-Bar Launch the application and scroll up/down on the first page. Expected Results: The navigation bar will be displayed with large title, and it won't collapse on scroll. Actual Results: The navigation bar will stay the same large size regardless of scrolling the underlying table view. If you tap on the first row, it'll push a second view controller on the navigation stack, which uses regular-sized navigation bar (i.e. "Large Title" is set to "Never"). Now, if you navigate back from this second page, you can observe that the navigation bar on the first page will properly collapse/expand on scrolling up/down - so pushing a second view controller on the stack and navigating back seemingly fixes the issue. Unsurprisingly however, the bug will occur again if you terminate the app and cold-launch it. Version/Build: iOS 11 (15A372) Configuration: No special configuration required.
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!
I've just figured out that the issue only manifests if "Large Titles" (aka navigationItem.largeTitleDisplayMode) is set via the Interface Builder. So if I set "Large Titles" to "Never" in interface builder, and set
navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAutomatic
inviewDidLoad
, then the interactive collapse/expand functionality works properly.Long story short: please consider fixing the case where
navigationItem.largeTitleDisplayMode
is set via Interface Builder. Thanks!