HomeiOS DevelopmentWhy is the navigation bar shade mode incorrect when 'Cut back Transparency'...

Why is the navigation bar shade mode incorrect when ‘Cut back Transparency’ is enabled in iOS 26? [closed]


So, the app makes use of adaptive shade units in Property.xcassets to deal with gentle and darkish modes. Usually, all the pieces works high-quality—the colours present accurately throughout the app, together with the navigation bar.

However when "Cut back Transparency" is turned on in iOS 26, the navigation bar stops respecting darkish mode. It will get pressured to a light-weight look, which breaks the visible consistency as a result of the remainder of the app continues to be in darkish mode.

I’m questioning if there’s a technique to both modify the asset catalog or deal with it in code in order that iOS nonetheless picks the proper shade for the navigation bar relying on the system look, even with Cut back Transparency enabled.

static func getAppearance() -> UINavigationBarAppearance {
    let look = UINavigationBarAppearance()
    look.configureWithOpaqueBackground()
    look.backgroundColor = .background 
    look.backgroundEffect = nil
    look.titleTextAttributes = [.foregroundColor: UIColor.navbarTitle]
    return look
}
func updateAppearance() {
    
    let look = Self.getAppearance()
    UINavigationBar.look().standardAppearance = look
    UINavigationBar.look().scrollEdgeAppearance = look
    UINavigationBar.look().compactAppearance = look

    self.navigationBar.standardAppearance = look
    self.navigationBar.scrollEdgeAppearance = look
    self.navigationBar.compactAppearance = look

    self.setNeedsStatusBarAppearanceUpdate()
}

The .background shade is definitely UIColor(named: "background"), the place the background is outlined in .xcasset file.
Why is the navigation bar shade mode incorrect when ‘Cut back Transparency’ is enabled in iOS 26? [closed]
now the identical code with "Cut back Transparency" possibility off:
enter image description here
whereas when "Cut back Transparency" possibility is on:
enter image description here

The issue is that what ever I do the iOS resolves .background shade to gentle model if the "Cut back Transparency" is on.
I ponder if there’s a workaround for this or it’s only a bug??

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments