UINavigationItem out of sync when using popToRootViewController

最后都变了- 提交于 2019-12-25 06:47:34

问题


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.

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.

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!


回答1:


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.




回答2:


do you get any message in the console like

nested push animation can result in corrupted navigation bar

and

Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.

if yes take a look at these few answers... but what they all basically mean is you are trying to pop from the navigation controller too early, probably before it is properly loaded...



来源:https://stackoverflow.com/questions/5902164/uinavigationitem-out-of-sync-when-using-poptorootviewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!