HomeiOS DevelopmentiOS 26 sheet adjusts to gentle/darkish background content material, however textual content/buttons...

iOS 26 sheet adjusts to gentle/darkish background content material, however textual content/buttons within the sheet don’t


I can get content material inside glass containers to regulate if I exploit .glassEffectTransition(.materialize) however that does not assist with .sheet. Anybody gotten this to work?

In darkish mode, the textual content is white. The (quick) sheet turns into white when the background is white, however the textual content doesn’t develop into black in that case.

iOS 26 sheet adjusts to gentle/darkish background content material, however textual content/buttons within the sheet don’t

To breed:

@out there(iOS 26, *)
struct MinimizedDetent: CustomPresentationDetent {
    static let peak: CGFloat = 50 // It have to be quick for it to set off content material coloration adaptivity
    static func peak(in context: Context) -> CGFloat? {
        return Self.peak
    }
}

@out there(iOS 26, *)
extension SwiftUI.PresentationDetent {
    static let minimized = Self.customized(MinimizedDetent.self)
}

struct ContentView: View {
    var physique: some View {
        ScrollView {
            Colour.black.body(peak: 600)
            Colour.white.body(peak: 600)
            Colour.black.body(peak: 600)
            Colour.white.body(peak: 600)
        }
        .sheet(isPresented: .fixed(true)) {
            if #out there(iOS 26, *) {
                HStack {
                    Textual content("What")
                }
                    .presentationDetents([.minimized])
                    .presentationBackgroundInteraction(.enabled)
            }
        }
    }
}

I am additionally all for any UIKit resolution, if it is solvable there.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments