导航条

-(void)createSCNav{

    //创建视图控制器

    TouTiaoViewController * toutiao = [[TouTiaoViewController alloc]init];

    toutiao.title=@"头条";

     YuLeViewController * yule = [[YuLeViewController alloc]init];

    yule.title=@"娱乐";

    TiYuViewController * tiyu = [[TiYuViewController alloc]init];

    tiyu.title=@"体育";

    CaiJingViewController * caijing = [[CaiJingViewController alloc]init];

    caijing.title=@"财经";

    KeJiViewController * keji = [[KeJiViewController alloc]init];

    keji.title=@"科技";

    GenTieViewController * gentie = [[GenTieViewController alloc]init];

    gentie.title=@"跟帖";

    QSYKViewController * qingsong = [[QSYKViewController alloc]init];

    qingsong.title=@"轻松一刻";

    SCNavTabBarController * SCNav = [[SCNavTabBarController alloc]init];

    SCNav.subViewControllers=@[toutiao,yule,caijing,keji,gentie,qingsong];

    [SCNavsetNavTabBarColor:[UIColor whiteColor]];

    [SCNavaddParentController:self];

    self.navigationItem.title = @"新闻";


}

//-(void)viewWillAppear:(BOOL)animated{

//    self.navigationController.navigationBarHidden = YES;

//

//}

//-(void)viewDidDisappear:(BOOL)animated{

//    self.navigationController.navigationBarHidden = NO;

//}

你可能感兴趣的:(导航条)