- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease];
} else {
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease];
}
CustomView1 *CustomView = [[CustomView1 alloc]initWithFrame:[[UIScreen mainScreen] bounds]];
self.viewController.view = CustomView;
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
이 AppDelegate.mrootViewController의 뷰를 변경하는 방법은 무엇입니까?
내가 CustomView
에 rootViewcontroller
의보기를 변경하려면, 위의 코드를 시도에 표시되지만 배경색이 검은 색을 유지하고 터치 이벤트 허용되지 않았다.
어디서 오류가 있습니까?
멋진! ^^. 귀하의 제안이 올바르게 작동합니다. –
그리고 조언 해 주셔서 감사합니다. (사이드 노드) –