iPad UISplitView 通用应用程序问题
我正在尝试使用适用于 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这听起来像是您的项目/构建设置的问题,而不是代码的问题。
选择您的目标,选择
获取信息
并确保您的目标设备系列
在所有构建配置上设置为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 yourTargeted Device Family
is set toiPad/iPhone
on all your build configurations, then do a clean build and try again.