ios - PopToRootViewController 在 UITabBarController 中显示不平衡消息

标签 ios uinavigationcontroller uitabbarcontroller

我有一个 iOS 应用程序,它有两个带有导航 Controller 的选项卡。其中一个选项卡上有一个注销按钮。注销按钮调用一个函数,该函数在另一个选项卡的导航 Controller 上执行 popToRootViewController。这将在调试器中显示以下消息:

Unbalanced calls to begin/end appearance transitions for <UIViewController>.

如果我更改到我试图清除的选项卡,然后调用 popToRootViewController 或者如果我手动循环浏览该导航 Controller 中的所有 View Controller 并调用 ,则不会出现此消息>弹出 View Controller popToRootViewControlleranimated 标志在这两种情况下都设置为 false。这个功能是有意的吗?

最佳答案

将 popRootViewAnimation 设置为“false”,希望它能解决您的问题。

self.navigationController?.popToRootViewControllerAnimated(false)

如果您想了解有关问题的详细信息,请查看此链接:

"Unbalanced calls to begin/end appearance transitions for DetailViewController" when pushing more than one detail view controller

关于ios - PopToRootViewController 在 UITabBarController 中显示不平衡消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44011783/

相关文章:

ios - 使用 UINavigationController 关闭 UIPopoverController

ios - 选中时如何删除覆盖 UITabBarItem 的蓝色方 block ?

IOS/Objective-C。在离开 View Controller 之前检测选项卡栏上选项卡的按下

ios - 取出arc4random()%x范围内的数字

ios - iOS11中的导航栏问题

iphone - iOS:使用多个库(xyz.a)构建XYZ.framework吗?

ios - UIViewController 和 UINavigationController 之间的区别?

swift - UITabBar isTranslucent 添加了一个额外的 UITabBar?

iphone - 如何从 AppStore 中删除 iPhone 应用程序版本?

ios - iOS 上的 SBJson 解析数据