課程
/移動(dòng)開發(fā)
/iOS
/iOS基礎(chǔ)教程之界面初體驗(yàn)
都是按照老師的寫法寫的,UIWindow的使用。我這會(huì)出這個(gè)error,是怎么回事?。壳蠼獯?。。
2015-12-08
源自:iOS基礎(chǔ)教程之界面初體驗(yàn) 2-2
正在回答
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
? ? // Override point for customization after application launch.
? ? _navigationController=[[UINavigationController alloc]initWithRootViewController:[[UIViewController alloc] init]];
? ? _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
? ? _window.rootViewController = _navigationController;
? ? _window.backgroundColor = [UIColor redColor];
? ? [_window makeKeyAndVisible];
? ? return YES;
}
AppDelegate.h里加入
@property (strong,nonatomic)UINavigationController *navigationController;
iOS 9以后要設(shè)置rootviewcontroller
把你AppDelegate.m里寫的UIwindow部分代碼發(fā)來(lái)看看
舉報(bào)
看了這么久的控制臺(tái),該換換口味了,讓你體會(huì)到界面的神奇所在
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2019-04-25
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
? ? // Override point for customization after application launch.
? ? _navigationController=[[UINavigationController alloc]initWithRootViewController:[[UIViewController alloc] init]];
? ? _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
? ? _window.rootViewController = _navigationController;
? ? _window.backgroundColor = [UIColor redColor];
? ? [_window makeKeyAndVisible];
? ? return YES;
}
AppDelegate.h里加入
@property (strong,nonatomic)UINavigationController *navigationController;
2018-07-09
iOS 9以后要設(shè)置rootviewcontroller
2015-12-09
把你AppDelegate.m里寫的UIwindow部分代碼發(fā)來(lái)看看