今天学习ios,但是发现创建的工程里面总是使用了Main.storyboard,那么如果想编码实现怎么办?
1.删除Main storyboard file base name
位于Supporting Files中的Info.plist
2.在AppDelegate的- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 方法中实现如下代码
ViewController *rootViewControllor = [[ViewController alloc] initWithNibName:nil bundle:nil]; self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.backgroundColor = [UIColor whiteColor]; self.window.rootViewController = rootViewControllor; [_window makeKeyAndVisible];
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-10-17 05:35:10