Button Shapes ON 和 SwiftUI TabView UI 看起来奇怪

huangapple go评论52阅读模式
英文:

Button Shapes ON and SwiftUI TabView UI strange

问题

  1. 我在SwiftUI上制作了一个非常简单的TabView,并将Button Shapes设置为ON,看到了一个奇怪的UI。您可以在Navigation View的顶部看到3个矩形。我不知道它是从哪里来的。

  2. 有人可以帮忙吗?

    1. 按钮形状为ON
    1. 奇怪的UI
  3. 这是示例代码

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

    ...
}

带有导航视图的代码

NavigationView {
    VStack(spacing: 20) {

    }
    .padding(.horizontal)
    .padding(.bottom, 30)
}
.navigationTitle("account".localized())
.navigationBarTitleDisplayMode(.inline)
.navigationBarBackButtonHidden(true)
}
.navigationViewStyle(.stack)
英文:

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

Button Shapes ON 和 SwiftUI TabView UI 看起来奇怪

2. UI strange

Button Shapes ON 和 SwiftUI TabView UI 看起来奇怪

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)

答案1

得分: 1

如果在打开“按钮形状”时出现了矩形,那么那里必定有您不知道的按钮。

英文:

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.)

huangapple
  • 本文由 发表于 2023年2月27日 15:46:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/75577891.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定