swiftui - SwiftUI - edgesIgnoringSafeArea 在 iOS 13.4 中的行为不同
问题描述
我注意到在我的应用程序中,.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)
}
}
这是它的显示方式:
有任何想法吗?
解决方案
我删除了修饰符,它似乎正确显示。就像其他人所说的那样,模拟器并不能很好地指示事物在实际设备上的实际呈现方式。
推荐阅读
- python-3.x - 如何使安全的频率分析分布对文本分析更安全,以防止将密文破解为明文
- spring-boot - Java多数据Jdbc和R2dbc问题
- azure - Azure 市场映像中的虚拟机,带有错误的 terraform 脚本
- flutter - Flutter:如何使用钩子重建 UI 的特定部分?
- arrays - 为什么我的蛮力解决方案比优化的哈希表解决方案更快?
- javascript - 如何使用 if 语句根据 Laravel 中的选择下拉框更改输入类型值
- android - 如何使 RecyclerView 在 Android PopupWindow 中工作?
- windows - 用于识别桌面软件的独特元素是什么?
- ubuntu - Camunda平台tomcat服务器8080端口打开jenkins。以至于无法在我的 ubuntu 系统中运行 camunda 平台
- ios - “SFJHSFJ”团队没有帐号。在“帐户”首选项窗格中添加新帐户或验证您的帐户是否具有有效凭据