Search code examples
iosswiftuitabview

Button Shapes ON and SwiftUI TabView UI strange


I made very simple TabView on SwiftUI and turn Button Shapes to ON and see a strange UI. You can see 3 rectangles at top of Navigation View. I don't know where's it come from.

Anybody can help?

1. Button shapes ON

enter image description here

2. UI strange

enter image description here

This is a sample code

TabView {
    ProfileView()
        .tabItem {
            Image(systemName: "account")
            Text("Profile")
        }

    ...
}

With Navigation View

NavigationView {
    VStack(spacing: 20) {
        
        }
        .padding(.horizontal)
        .padding(.bottom, 30)
    }
    .navigationTitle("account".localized())
    .navigationBarTitleDisplayMode(.inline)
    .navigationBarBackButtonHidden(true)
}
.navigationViewStyle(.stack)

Solution

  • If the rectangles appeared when you toggled "Button Shapes" on, then there must be buttons there you didn't know about.

    (I would have put this in a comment, but I don't have that privilege as of yet.)