问题描述
我点击一个标签栏项目,它会触发 poptoRootViewControllerAnimated.大多数情况下,它按预期工作,但在某些情况下,它会弹出到正确的视图,但导航项不同步,与我之前所在的视图卡住".
I tap a tab bar item, which triggers poptoRootViewControllerAnimated. Most of the time it works as expected, but in some cases it pops to the correct view, but the navigation item is out of sync, "stuck" from the view i previously was at.
我读到有人在横屏模式下使用 iPad 时遇到此问题,但我找到的解决方案在这种情况下不起作用.这是一款纵向模式的 iPhone 应用.
I've read about people having this problem with iPad's, when in landscape mode, but the solutions I've found don't work in this case. This is an iPhone app in portrait mode.
在模拟器和实际 iPhone 上都会发生.如果有人有建议或解决方案,我会很高兴的!
Happens with the simulator as well as on an actual iPhone. If someone has a suggestion or solution i'll be a very happy man!
推荐答案
事实证明,不同的 iOS 版本对此的处理方式不同.这只发生在旧版本上,所以我们不得不在那里手动重建堆栈.
Turns out that the different iOS versions handle this differently. This only occured on the older versions, so we had to rebuild the stack manually there.
这篇关于使用 popToRootViewController 时 UINavigationItem 不同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!