UIWindow

//uiwindow创建的四个步骤

//(1)给大小

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

(2)给颜色

self.window.backgroundColor = [UIColor whiteColor];

(3)可视化

[self.window makeKeyAndVisible];

(4)设置根控制器

viewViewController *viewc = [[viewViewController alloc]init];

//设置一个导航控制器

UINavigationController *navi = [[UINavigationController alloc]initWithRootViewController:viewc];

self.window.rootViewController = navi;

你可能感兴趣的:(UIWindow)