Ipad:SplitViewController 黑色 DetailViewController
我有以下问题。
我正在开发一个使用 splitViewController 作为根控制器的应用程序。在 appDelegate 中,我在方法 didFinishLaunchingWithOptions 中有此代码:
[self.window addSubview:splitViewController.view];
[self.window makeKeyAndVisible];
self.sendData = [[[SendData alloc] init] autorelease];
showEventsViewController.sendData = self.sendData;
LoginView *lvc = [[LoginView alloc] initWithNibName:@"LoginView" bundle:nil];
lvc.delegate = self;
[splitViewController presentModalViewController:lvc animated:NO];
[lvc release];
return YES;
登录完成后,我关闭登录视图并显示 splitViwController。
此外,我的应用程序需要仅在横向模式下运行,因此我配置了 plist 以避免仅横向模式,并在每个视图控制器中设置此代码:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Overriden to allow any orientation.
if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft)
return YES;
if (interfaceOrientation == UIInterfaceOrientationLandscapeRight)
return YES;
return NO;
}
但是当我以纵向模式运行我的应用程序时(显示登录视图)就在横向模式中)并且我完成登录, splitview 以横向模式显示,但DetailViewController 是全黑的(主视图处于横向模式)
发生了什么?
谢谢
i have the following problem.
I'm developing an app with a splitViewController as the root controller. In the appDelegate i have this code in method didFinishLaunchingWithOptions:
[self.window addSubview:splitViewController.view];
[self.window makeKeyAndVisible];
self.sendData = [[[SendData alloc] init] autorelease];
showEventsViewController.sendData = self.sendData;
LoginView *lvc = [[LoginView alloc] initWithNibName:@"LoginView" bundle:nil];
lvc.delegate = self;
[splitViewController presentModalViewController:lvc animated:NO];
[lvc release];
return YES;
When the login is complete, i dismiss the loginView and i show the splitViwController.
Besides, my application needs to run only in landscape mode, so i have configured the plist in order to avoid only landscape mode and set this code in each view controller:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Overriden to allow any orientation.
if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft)
return YES;
if (interfaceOrientation == UIInterfaceOrientationLandscapeRight)
return YES;
return NO;
}
But when i run my app in portrait mode (the login view is shown right in landscape) and icomplete the login, the splitview is shown in landscape mode but the detailViewController is whole black (the master view is in landscape mode)
What is happening?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论