HomeiOS DevelopmentEasy methods to make the ToolbarItemGroup within the toolbar group background clear...

Easy methods to make the ToolbarItemGroup within the toolbar group background clear and with glass impact? [closed]


How can I make the background of a ToolbarItemGroup clear with a glass (blur) impact in iOS 26? Is there a supported method to obtain this?

I’ve tried to make the background clear nevertheless it did not work with tintcolor!

Easy methods to make the ToolbarItemGroup within the toolbar group background clear and with glass impact? [closed]

import SwiftUI


struct ContentView: View {
    
    var physique: some View {
        NavigationStack {
            VStack {
                ContentUnavailableView {
                    Label("Adapting toolbar components to the Liquid Glass Design System", systemImage: "tray.fill")
                } description: {
                    Textual content("Discover the right way to design and implement toolbars in iOS 26 utilizing Apple’s new Liquid Glass.")
                        .padding()
                }
            }
            
            .toolbar {
                ToolbarItemGroup(placement: .topBarTrailing) {
                    Button("Draw", systemImage: "pencil") {
                        // Button motion right here
                    }.glassEffect()
                    
                    Button("Erase", systemImage: "eraser") {
                        // Button motion right here
                    }.glassEffect()
                }
                
                ToolbarSpacer(.mounted, placement: .topBarTrailing)
                
                ToolbarItem(placement: .topBarTrailing) {
                    Button("Save", systemImage: "checkmark") {
                        // Button motion right here
                    }
                    .buttonStyle(.glass)
                    
                    
                    .glassEffect()
                }
            }
            .background(Colour.crimson)
            
        }
    }
    
}

#Preview {
    ContentView()
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments