【发布时间】:2023-02-08 18:33:12
【问题描述】:
有一个奇怪的错误/错误。关闭并打开应用程序后,触摸停止在顶部工作。
重现:
- 点击蓝条触发“onTapGesture”
- 向上滑动返回跳板
- 打开应用程序
- 向下拖动关闭模式
- 单击蓝色条(不起作用)
有趣的是,如果我删除“Color.red.ignoresSafeArea()”,它会按预期工作。在 iOS 15 中,它也按预期工作。
这是 SwiftUI 中的错误吗? 有什么解决方法的建议吗?
public struct TestView: View { @State private var showModal = false public var body: some View { ZStack { Color.red.ignoresSafeArea() VStack(spacing: 0) { Color.blue .frame(height: 20) .onTapGesture { showModal = true } Color.white } } .sheet(isPresented: $showModal, content: { Text("HELLO") }) } }
【问题讨论】:
标签: swiftui