博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
IOS 开发didFinishLaunchingWithOptions 设置启动View
阅读量:4315 次
发布时间:2019-06-06

本文共 1323 字,大约阅读时间需要 4 分钟。

 

1.单View

self.window= [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

self.window.backgroundColor=[UIColor grayColor];
IOS01ButtonViewController *ios01MyButton=[[IOS01ButtonViewController alloc]init];
self.window.rootViewController=ios01MyButton;
[self.window makeKeyAndVisible];

 

 

2.导航

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

self.window.backgroundColor = [UIColor whiteColor];
NavigationBarViewController *root=[[NavigationBarViewController alloc]init];
NavigationViewController *nav = [[NavigationViewController alloc]initWithRootViewController:root];
self.window.rootViewController=nav;
/*UITabBarViewController
*navigation=[[UITabBarViewController alloc]init];
self.window.rootViewController =navigation;
ButtonViewController *button1=[[ButtonViewController alloc]init];
button1.tabBarItem.title=@"Messgae";
button1.tabBarItem.badgeValue=@"99+";
TooBarViewController *button2=[[TooBarViewController alloc]init];
button2.tabBarItem.title=@"Messgae";
button2.tabBarItem.badgeValue=@"99+";
button2.view.backgroundColor=[UIColor blueColor];
//[navigation addChildViewController:button1];
//[navigation addChildViewController:button2];
navigation.viewControllers=@[button1,button2 ];
[self.window makeKeyAndVisible];

转载于:https://www.cnblogs.com/zhangleixy/p/4933526.html

你可能感兴趣的文章
NSTextView 文字链接的定制化
查看>>
第五天站立会议内容
查看>>
CentOs7安装rabbitmq
查看>>
(转))iOS App上架AppStore 会遇到的坑
查看>>
解决vmware与主机无法连通的问题
查看>>
做好产品
查看>>
项目管理经验
查看>>
笔记:Hadoop权威指南 第8章 MapReduce 的特性
查看>>
JMeter响应数据出现乱码的处理-三种解决方式
查看>>
获取设备实际宽度
查看>>
Notes on <High Performance MySQL> -- Ch3: Schema Optimization and Indexing
查看>>
Alpha冲刺(10/10)
查看>>
数组Array的API2
查看>>
为什么 Redis 重启后没有正确恢复之前的内存数据
查看>>
No qualifying bean of type available问题修复
查看>>
第四周助教心得体会
查看>>
spfile
查看>>
Team Foundation Service更新:改善了导航和项目状态速查功能
查看>>
WordPress资源站点推荐
查看>>
Python性能鸡汤
查看>>