在 iPad 上,当我的导航层次结构以与以下类似的样式呈现时:
NavigationView {
NavigationLink(destination: Text("Hi").actionSheet(isPresented: .constant(true)) { () -> ActionSheet in
ActionSheet(title: Text("welllllll"))
},
tag: true,
selection: $didNavigateToChild) {
Button(action: {
self.didNavigateToChild = true
}) {
Text("Let's go!")
}
}
}
.navigationViewStyle(StackNavigationViewStyle())
当弹出框、操作表或工作表出现时(在这种情况下,ActionSheet
带有文本“wellllllll”),子视图被关闭(Text("Hi")
),我最终回到Text("Let's go!")
.
我一直在试图抓住所谓的解雇,但我是 SwiftUI 的新手,我的旧符号断点让我失望了。
无论出于何种原因,这只发生在 iPad 上。Presenting ActionSheet
and Sheet
from child NavigationView
s 在 iPhone 上工作得很好,没有任何奇怪的导航副作用。