DetailView 未在 SplitViewController 中加载

发布于 2024-10-01 02:59:16 字数 1020 浏览 0 评论 0 原文

我在 TabBarApplication 中使用 SplitViewController 进行管理。 现在的问题是,尝试在横向模式下启动应用程序(SplitViewController 是我的 TabbarApp 中的第一个视图),详细信息视图未加载。以纵向启动它效果很好,在以纵向启动后将我的 iPad 推到横向后也是如此。

这里有2个链接:

从纵向开始,切换到横向

从横向启动

我修改了 willShowViewController 方法,因为我什至无法在横向启动它,

- (void)splitViewController: (UISplitViewController*)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem {

    NSMutableArray *items = [[toolbar items] mutableCopy];
    //XLog("second: %i",[items count]);
    if([items count] > 0) {
        [items removeObjectAtIndex:0];
        [toolbar setItems:items animated:YES];
    }
    [items release];
    self.popoverController = nil;

}

如果查询阻止我的应用程序在横向崩溃。

我不知道为什么我的详细视图控制器没有显示,而我的 splitview 的根视图控制器显示在整个宽度上。

有什么想法吗?

谢谢!

i managed using a SplitViewController in a TabBarApplication.
The problem now is, trying to start the Application (the SplitViewController is the first View in my TabbarApp) in Landscape mode the Detail View gets not loaded. Starting it in Portrait works fine, also after pushing my iPad to Landscape after starting in Portrait.

Here 2 Links:

Starting in Portrait, switching to Landscape

Starting in Landscape

i've modified the willShowViewController method, because i couln't even start it in landscape

- (void)splitViewController: (UISplitViewController*)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem {

    NSMutableArray *items = [[toolbar items] mutableCopy];
    //XLog("second: %i",[items count]);
    if([items count] > 0) {
        [items removeObjectAtIndex:0];
        [toolbar setItems:items animated:YES];
    }
    [items release];
    self.popoverController = nil;

}

the if query prevents my app from crashing in landscape.

i have no idea why my detailviewcontroller doesn't show up and my rootviewcontroller of the splitview shows up over the complete width.

any ideas?

thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

墨落画卷 2024-10-08 02:59:16

特别是在 iOS 4.2 中,我认为这是一个错误。
我找到了一种解决方法并将其写在这里:

如何将我的应用程序限制为横向模式?

希望它有帮助

Specially in iOS 4.2 I believe that is a bug.
I have found a work-around and wrote it here:

How to restrict my app to landscape mode?

Hope it helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文