昨天Xcode 11.3发布,出现了新问题,如果您按DetailView并使用默认的后退按钮取回,则您无法再次按自定义按钮再按一次DetailView,是否有任何建议?
class Model: ObservableObject {
@Published var isPushed = false
}
struct ContentView: View {
@EnvironmentObject var model: Model
var body: some View {
NavigationView {
VStack {
Button("push") {
self.model.isPushed = true
}
NavigationLink(destination: DetailView(), isActive: $model.isPushed) { EmptyView() }
}
}
}
}
struct DetailView: View {
@EnvironmentObject var model: Model
var body: some View {
Button("get me back") {
self.model.isPushed = false
}
}
}
同样的问题
struct ContentView: View {
var body: some View {
NavigationView {
VStack {
NavigationLink(destination: Text("Pushed")) { Text("push") }
}
}
}
}
答案 0 :(得分:2)
您不是第一个问过this question的人。尝试降级xCode。我认为Apple应该在新的更新中修复此错误,我也很快会在Apple反馈助手中撰写。
更新:已发送反馈给Apple