底部分栏控件

2017-08-25  本文已影响0人  谁说_

//初始化第一个页面

FOURViewController * four = [[FOURViewController alloc]init];

four.view.backgroundColor = [UIColor yellowColor];

//设置第一个页面的分栏标题

four.tabBarItem.title = @"four";

//设置第一个页面的图分栏图片

four.tabBarItem.image = [UIImage imageNamed:@"4"];

//

UINavigationController * theNav4 = [[UINavigationController alloc]initWithRootViewController:four];

//设置中导航条的背景颜色

theNav4.navigationBar.barTintColor = [UIColor redColor];

//将导航控制器与底部分栏控件相绑定

_tabBar.viewControllers = @[theNav1,theNav2,theNav3,theNav4];

self.window.rootViewController = _tabBar;

上一篇 下一篇

猜你喜欢

热点阅读