美文网首页iOS Developer
IOS tableBar设置方法

IOS tableBar设置方法

作者: JakieZhang | 来源:发表于2016-12-08 09:34 被阅读152次

RedViewController*redVC = [[RedViewControlleralloc]initWithNibName:@"RedViewController"bundle:nil];

GreenViewController*greenVC = [[GreenViewControlleralloc]init];

BlueTableViewController*blueTVC = [[BlueTableViewControlleralloc]init];

UITabBarController*tabBarController = [[UITabBarControlleralloc]init];

UINavigationController*navi = [[UINavigationControlleralloc]initWithRootViewController:redVC];

//navi.tabBarItem.title = @"红色";

[tabBarControlleraddChildViewController:navi];

[tabBarControlleraddChildViewController:greenVC];

[tabBarControlleraddChildViewController:blueTVC];

//设置开始显示是1位置的子控制器

tabBarController.selectedIndex=1;

self.window= [[UIWindowalloc]initWithFrame:[UIScreenmainScreen].bounds];

self.window.rootViewController= tabBarController;

[self.windowmakeKeyAndVisible];

相关文章

网友评论

    本文标题:IOS tableBar设置方法

    本文链接:https://www.haomeiwen.com/subject/zpnjmttx.html