UINavigationItem out of sync when using popToRootV

2019-09-01 06:24发布

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!

2条回答
劳资没心,怎么记你
2楼-- · 2019-09-01 06:27

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.

查看更多
来,给爷笑一个
3楼-- · 2019-09-01 06:32

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...

查看更多
登录 后发表回答