模擬ios應用加載頁面
1:設置應用程序系統主界面加載接口為空:Main interface=null;
2: 在AppDelegate實現didFinishLaunchingWithOptions方法


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// 初始化窗口
self.window=[[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
// 設置窗口顏色
self.window.backgroundColor=[UIColor redColor];
// 自定義viewcontroller
// UIViewController *root=[[UIViewController alloc]init];
// root.view.backgroundColor=[UIColor blueColor];
// 創建UIStoryboard對象
UIStoryboard *storybord= [UIStoryboard storyboardWithName:@"Main" bundle:nil];
// 1:創建指定storybordId的viewcontroller
UIViewController *root=[storybord instantiateViewControllerWithIdentifier:@"green"];
// 2:創建指定默認的viewcontroller
// UIViewController *root2=[storybord instantiateInitialViewController];
// 設置rootViewController
self.window.rootViewController=root;
//顯示窗口
[self.window makeKeyAndVisible];
return YES;
}

posted on 2017-03-23 23:46 張亮13128600812 閱讀(147) 評論(0) 收藏 舉報
浙公網安備 33010602011771號