抛弃storyBoard,纯代码
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//大小与屏幕保持一致
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
[self.window setBackgroundColor:[UIColor whiteColor]];
//让window显示在手机屏幕上
[self.window makeKeyAndVisible];
//xcode7之后,必须给windwo设置一个根控制器,否则运行会报错
[self.window setRootViewController:[[MainViewController alloc] init]];
return YES;
}
IOS学习(一)视图创建
最新推荐文章于 2023-11-29 21:06:11 发布