Adopt UINavigationBarAppearance.configureWithDefaultBackground so Stack headers can render the iOS 26 Liquid Glass material #4021
kajetangit
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What's missing
On iOS 26 with the Liquid Glass design enabled (no
UIDesignRequiresCompatibilityopt-out), there's no way to make the Stack header adopt the system Liquid Glass material. The bar is always either fully transparent (headerTransparent: true/ alpha-0 background) or a flat opaque surface — never glass.The per-button glass pill on
UIBarButtonItem(back chevron, bar buttons) renders correctly, so UIKit is glass-aware in these builds. It's specifically the bar background that has no path through.Why it's worth adding
Apple's HIG explicitly directs apps to let the navigation layer use the built-in Liquid Glass material:
Today, any consumer of
react-native-screens(including expo-router and@react-navigation/native-stack) is structurally unable to follow that guidance for the Stack header background.Where it lives in the code
In
ios/RNSScreenStackHeaderConfig.mm(verified on4.23.0andmain), only two of the threeUINavigationBarAppearanceconfigure methods are ever called:+ (UINavigationBarAppearance *)buildAppearance:(UIViewController *)vc withConfig:(RNSScreenStackHeaderConfig *)config { UINavigationBarAppearance *appearance = [UINavigationBarAppearance new]; if (config.backgroundColor && CGColorGetAlpha(config.backgroundColor.CGColor) == 0.) { [appearance configureWithTransparentBackground]; } else { [appearance configureWithOpaqueBackground]; // catches nil and every opaque value } if (config.backgroundColor) { appearance.backgroundColor = config.backgroundColor; } // ... }configureWithDefaultBackground— the API that yields the system material (Liquid Glass on iOS 26, classic chrome on earlier versions) — isn't called anywhere in the iOS sources. That includesios/gamma/stack/(the experimental Stack v5 from4.25.0-beta.*), where the navigation controller and screen controller are currently scaffold-only.Suggested improvement
A third branch in
buildAppearance:that calls[appearance configureWithDefaultBackground], opted into via whatever JS-side surface the maintainers prefer.Related
headerTransparent: true. Worth noting becauseheaderTransparentis the nearest existing workaround, and Header title and buttons do not adapt to contrasting background (Liquid Glass) #3782 means it isn't a real path to the desired behavior.Verified on
react-native-screens:4.23.0(alsomainand4.25.0-beta.*)UIDesignRequiresCompatibility: not set (opted into Liquid Glass design)Beta Was this translation helpful? Give feedback.
All reactions