SwiftUI -edgesIgnoringSafeArea 在 iOS 13.4 中的行为不同

Jas*_*ain 6 swiftui

我注意到在我的应用程序中 .edgesIgnoringSafeArea 在 iOS 13.3 和 iOS 13.4 中呈现不同的视图。

在我的 ContentView 中,我应用了 .edgesIgnoringSafeArea(.top) 的修饰符。这在 13.4 之前的所有 iOS 13 版本中都能正确显示。现在在 13.4 的 GM 中,视图的顶部和底部被切断了。

这是我的内容视图

struct ContentView: View {
@EnvironmentObject var session: SessionStore
func getUser() {
    session.listen()
}



var body: some View {

        Group {
            ZStack {
                TabView {
                    ExploreView().tabItem {
                        Image(systemName: "house.fill")
                        Text("Explore")
                    }.tag(1)
                    FestivalsView().tabItem {
                        Image(systemName: "globe")
                        Text("Festivals")
                    }.tag(2)
                    ProfileView().tabItem {
                        Image(systemName: "person.crop.circle.fill")
                        Text("Profile")
                    }.tag(3)
                }
                .accentColor(Color("wdwPurple"))
                .edgesIgnoringSafeArea(.top)
    }
        }.onAppear(perform: getUser)
    }
}
Run Code Online (Sandbox Code Playgroud)

这是它的显示方式:

在此处输入图片说明

有任何想法吗?

小智 0

事实上,在 iOS GM 13.4 上看起来是正确的,因为忽略顶部安全区域