11.2 C
Canberra
Wednesday, December 3, 2025

The best way 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 technique to obtain this?

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

The best way 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 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

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles