IOS 開發didFinishLaunchingWithOptions 設置啟動View


 

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];


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM