Ipad:SplitViewController 黑色 DetailViewController

发布于 2024-10-20 04:22:41 字数 1122 浏览 2 评论 0原文

我有以下问题。

我正在开发一个使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文