Weird transparency in sidebar in iPad app

I have an iPad app with a classic sidebar. It's been working fine for years. Now with iPadOS 26 the sidebar sometime gets this fake transparency that makes it really hard to quickly grok. A part of Liquid Glass seems to be to sometimes (but not always) take whatever is in the secondary area (the main big content), blur it, mirror it and then use as the background for the sidebar. This is silly and does not work at all for an app like mine. It maybe looks decent if your background is a photo or similar, but not for an app that manages data. Not all views cause the sidebar to get this ugly unreadable background. In most of the cases the sidebar keeps its normal opaque background that it has always had.

See this example for how it looks when it's really bad:

This is how it should look. Notice that the content of the "main view" is pretty similar to the case where it gets the ugly background. The difference is the segmented thing at the top, ie. a different "root view".

Is there some good way for me to force the sidebar to always have an opaque background? I guess I could make a ZStack and put a solid color as the background behind the sidebar, but those kinds of hacks are better to avoid.

This can not be how some UI designer envisioned that apps should look? Maybe I'm missing some new modifier or setting somewhere that would led me opt out from this aspect of Liquid Glass? Apart from this it looks pretty nice. There are some bugs where the contents of the main area gets clipped when the sidebar is shown, hidden and then shown again, but that's for another time (and it's surely known already (if the bug tracking system allowed me to search I could verify)).

So, any way to make my app look nice again?

Based on the docs this should be what I really want:

https://developer.apple.com/documentation/swiftui/view/backgroundextensioneffect(isenabled:)

It's supposed to disable the background, but it seems to not do anything at all. The code in the commented out region is still the only that works reliably.

NavigationSplitView(sidebar: {
        sidebarView
            //.background {
            //    Color.red
            //        .edgesIgnoringSafeArea(.all)
            //}
    }, detail: {
        detailView
            .backgroundExtensionEffect(isEnabled: false)
    })

I had hoped that maybe this could fix the background bug:

NavigationSplitView(sidebar: {
        sidebarView
            .presentationBackground {
                SwiftUI.Color.red
            }
    }, detail: {
        detailView
    })
}

Unfortunately that has no effect and the docs for the presentationBackground() modifier are... not too informative.

Ok, got a solid background with:

sidebarView
    .background {
        Color.red
           .edgesIgnoringSafeArea(.all)
        }

Still some of my detail views cause there to be narrow artefacts on the left side of the sidebar that are remnants of the mirrored content. This looks really ugly but at least the sidebar is legible now.

Is there some way to not have the detail view background messing with the sidebar area at all?

Accepted Answer

Based on the docs this should be what I really want:

https://developer.apple.com/documentation/swiftui/view/backgroundextensioneffect(isenabled:)

It's supposed to disable the background, but it seems to not do anything at all. The code in the commented out region is still the only that works reliably.

NavigationSplitView(sidebar: {
        sidebarView
            //.background {
            //    Color.red
            //        .edgesIgnoringSafeArea(.all)
            //}
    }, detail: {
        detailView
            .backgroundExtensionEffect(isEnabled: false)
    })

Why the backgroundExtensionEffect() seems to enabled by default seems to be a bug somewhere. I most certainly do not enable it anywhere and my understanding is that then I should not see this background anywhere at all. The fact that it shows up randomly for some of my detail views probably confirms that there's a bug.

No, I will not spend more time and create a bug report along with a full project that demonstrates this bug, as likely it will not show up in a simple demo app.

Weird transparency in sidebar in iPad app
 
 
Q