1、選擇模版Single View application
2、將Main.storyboard 和LaunchScreen.xib刪除
3、在Info.plist中,把Launch screen interface file base name 以及Main storyboard file base name刪除
4、點擊在target里的Use Asset Catalog,對話框里直接點擊Migrate
5、在AppDelegate的第一個方法里面添加代碼:
OC:
(1)、創建window
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
(2)、設置window背景
self.window.backgroundColor = [UIColor whiteColor];
(3)、使window可見
[self.window makeKeyAndVisible];
Swift
self.window = UIWindow(frame:UIScreen.mainScreen().bounds);
self.window!.backgroundColor = UIColor.whiteColor();
self.window!.makeKeyAndVisible();
新聞熱點
疑難解答