现在的位置: 首页 > 综合 > 正文

UITabViewControl中放nav点击自动pop解决方法

2017年11月30日 ⁄ 综合 ⁄ 共 303字 ⁄ 字号 评论关闭
//每次点击当前tab的时候会触发
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)vc {
    NSLog(@"shouldSelect");
    //当前选中的tab
    UIViewController *selectTab = tabBarController.selectedViewController;
    //vc:  将要选中的tab
    //判断是不是选择了自己
    if ([selectTab isEqual:vc]) {
        return false;
    }
    return true;
}

抱歉!评论已关闭.