- 通话时
router1()
,快速(白屏)闪烁 - 通话
router2()
时无闪烁
注意:在这两种情况下都navigationLevelsStack
只有1 个元素
看来这仅取决于router1()
使用ForEach
?
有没有办法ForEach
不引起闪烁?
@ViewBuilder func router1(_ stateProvider: StateProvider,_ events: Events) -> some View {
ZStack {
ForEach(navigationLevelsStack, id: \.self.URI) { screenIdentifier in
self.screenPicker(screenIdentifier)
}
}
}
@ViewBuilder func router2(_ stateProvider: StateProvider,_ events: Events) -> some View {
ZStack {
self.screenPicker(navigationLevelsStack.last!)
}
}
}