【发布时间】:2013-12-12 13:53:04
【问题描述】:
参考this link,我在AppDelegate.h中添加了UITabDelegate和UITabBarControllerDelegate并添加了
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
if ([viewController isKindOfClass:[UINavigationController class]])
{
[(UINavigationController *)viewController popToRootViewControllerAnimated:NO];
}
}
在AppDelegate.m。问题仍然没有解决。我在我的项目中使用 XIB 并处理登录和注销以相应地启用和禁用标签栏。
【问题讨论】:
-
我相信该方法中的 viewController 将是导航控制器根视图控制器而不是 uinavigationcontroller 直接。
-
我正在使用带有导航栏的标签栏
标签: ios objective-c uitabbarcontroller uitabbar