我不想将 SwiftUI 显示View
为全屏watchOS
(没有取消/返回按钮或时钟)
我尝试Sprite Kit Scene
在视图中添加 a 并设置,.edgesIgnoringSafeArea(.all)
但我仍然可以隐藏它们或在顶部栏下放置一个视图。
事实证明它确实“工作”,即使使用 SwiftUI:
使用 SwiftUI(watchOS 7):
@main
struct BitApp: App {
@SceneBuilder var body: some Scene {
WindowGroup {
ContentView()
.edgesIgnoringSafeArea(.all)
}
WKNotificationScene(controller: NotificationController.self, category: "myCategory")
}
}
删除任何并NavigationView
使用它就可以了!edgesIgnoringSafeArea
编辑:它不会移除时钟,因为它会位于 SpriteKit 场景前面的角落。
除非是游戏,否则不可能去掉顶部的空间,watchOS 会保留它,以便用户始终可以看到时间。