24.5 C
Canberra
Saturday, January 3, 2026

In SwiftUI Toolbar button and picture are seen by means of full display overlay view


So I’ve some view with ToolBar on the prime. It has main Button and trailing Picture.

var physique: some View {
        NavigationView {
            ZStack {
                content material()
                VStack {
                    GeometryReader { geometry in
                        navigationBarColor
                            .body(top: geometry.safeAreaInsets.prime)
                            .edgesIgnoringSafeArea(.prime)
                    }
                    Spacer()
                }

                if viewModel.isShowingLeagueInfo {
                    CustomLeagueInfoOverlay(isPresented: $viewModel.isShowingLeagueInfo)
                }
            }
            .navigationBarTitleDisplayMode(.inline)
            .toolbar {
                LeagueExperienceToolbar(league: viewModel.league) {
                    dismiss()
                }
            }
            .alert(merchandise: $viewModel.alertData) { information in
                Alert(
                    title: Textual content(information.title),
                    message: Textual content(information.message),
                    dismissButton: information.retry != nil
                    ? .default(Textual content("Retry".localize()), motion: information.retry)
                    : .cancel(Textual content("Okay"))
                )
            }
            .fullScreenCover(isPresented: $viewModel.isShowingWeeklyResetSummary) {
                WeeklyLeagueResetSummaryModuleBuilder.construct()
            }
        }
    }

Right here CustomLeagueInfoOverlay is a view that presents itself as a sheet: clear background with some content material on the backside.

The problem is that when sheet background is offered, Button and Picture are proven over sheet background and could also be tapped. How can I repair this conduct and make the sheet cowl toolbar gadgets?

In SwiftUI Toolbar button and picture are seen by means of full display overlay view

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