UITabBarController

2017年9月12日
1.系统自带的底部menuBar 如何隐藏 vc.hidesBottomBarWhenPushed = YES;如果是自定义的另外一套机制

    HuPayBackViewController *vc = [[HuPayBackViewController alloc] initWithModel:model];
    vc.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:vc animated:YES];

2.首次进入tableView界面 frame设置不对问题修改
显示不全:


UITabBarController_第1张图片
image.png

问题:自定义menuBar无法正常隐藏,首次进入tableVIew界面【发现,培训,我的】 tableview,frame会设置不正确,多了49menubar的高解决:【禁用掉自动设置的内边距】
补充: (状态栏iOS7 之后,都不需要自动偏移状态栏20了)

self.automaticallyAdjustsScrollViewInsets = NO;
image.png

2017年7月1日
1.默认先跳到第n个viewController

 if (self.accountType == noAccount || self.accountType == personAccount) {
        //无账号
        //未登录的时候,默认选中发现界面
        if (index == 2) {
            button.selected = YES;
            self.selectedViewController = [self.viewControllers objectAtIndex:2];
            _selectBtn = button;
        }
    }

2017年6月27日
1.UITabBarController 无法调用pushViewController方法
原因:该类没有pushViewController方法
解决:需要定位到UITabBarController的子类UINavigationController,通过子类实现跳转

- (void)showUserRightAlertView{
    HuUserRiqhtAlertView *alertView = [[HuUserRiqhtAlertView alloc] init];
    WS(weakSelf)
    alertView.confirmClick = ^{
        
        Curi_wkwebview_controller *ctrl = [[Curi_wkwebview_controller alloc] init];
        ctrl.urlString = [HuConfigration sharedHuConfigration].udeskUrl ?: @"";
        ctrl.titleString = @"医院开通咨询";
        
        NSArray *viewControllers = self.viewControllers;
        if (weakSelf.selectedIndex < viewControllers.count) {
            [(UINavigationController*)viewControllers[self.selectedIndex] pushViewController:ctrl animated:YES];
        }
    };
    [alertView show];
}

- (void)addChildViewController{

    DiscoverMainViewController *vc = [[DiscoverMainViewController alloc]init];
    UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc];
    [self addChildViewController:nav];
    
    PersonalCenterViewController *PCVc = [[PersonalCenterViewController alloc]init];
    QQHLNavigationViewController *nav4 = [[QQHLNavigationViewController alloc]initWithRootViewController:PCVc];
    [self addChildViewController:nav4];
}

如果您发现本文对你有所帮助,如果您认为其他人也可能受益,请把它分享出去。

你可能感兴趣的:(UITabBarController)