iPad UISplitView 通用应用程序问题

发布于 2024-10-09 12:13:18 字数 635 浏览 0 评论 0原文

我正在尝试使用适用于 iPad 的简单 UISplitView 将 iPhone 应用程序转换为通用应用程序。我已将以下内容添加到应用程序委托中:

> if (UI_USER_INTERFACE_IDIOM() ==
> UIUserInterfaceIdiomPad) {
>         [window addSubview:splitViewController.view]; 
>         [window makeKeyAndVisible];
>     } else {
>         [window addSubview:tabBarController.view]; 
>         [window makeKeyAndVisible];
>     }

但是,它没有在 IB 中提供在 MainWindow.nib 中添加 UISplitViewController 的选项。因此,在创建新笔尖并添加 App Delegate 对象后,我将 SplitViewController 与我在 App delegate 中声明的 splitView 链接起来 - 但是当我尝试在 iPad 模拟器上运行它时,它仍然显示为 iPhone在 iPad 上运行的应用程序。 (@ 1/2 尺寸)有什么想法吗?

I am attempting to turn an iPhone app into a Universal App with a simple UISplitView for the iPad. I have added the following to the App Delegate:

> if (UI_USER_INTERFACE_IDIOM() ==
> UIUserInterfaceIdiomPad) {
>         [window addSubview:splitViewController.view]; 
>         [window makeKeyAndVisible];
>     } else {
>         [window addSubview:tabBarController.view]; 
>         [window makeKeyAndVisible];
>     }

However, it doesn't give me the option in IB to add a UISplitViewController in the MainWindow.nib. So, after creating a new nib and adding the App Delegate object, I linked up a SplitViewController with the splitView that I declared in the App delegate - however when I try to run it on the iPad simulator, it is still showing up as an iPhone App running on an iPad. (@ 1/2 size) Any thoughts?

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

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

发布评论

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

评论(1

叶落知秋 2024-10-16 12:13:18

这听起来像是您的项目/构建设置的问题,而不是代码的问题。

选择您的目标,选择获取信息并确保您的目标设备系列在所有构建配置上设置为iPad/iPhone,然后执行清理构建并重试。

This sounds like an issue with your Project/Build settings rather than code at this point.

Select your Target, choose Get Info and make sure your Targeted Device Family is set to iPad/iPhone on all your build configurations, then do a clean build and try again.

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