将 iPhone/iPad 应用程序降级为仅限 iPhone 的 XIB

发布于 2024-09-09 19:26:44 字数 307 浏览 1 评论 0原文

我最近通过右键单击目标并选择“升级 iPad 的当前目标”将我的 iPhone 应用程序转换为适用于 iPad。然后,每次我使用 iPad 模拟器打开应用程序时,它都会打开新创建的 MainWindow-iPad.xib。

然而,我遇到了问题,所以我想做的是“降级”iPhone 应用程序,以便它只在 iPhone/iPad 上运行 iPhone xib。 (因此,当它在 iPhone 上运行时,它会正常运行,而在 iPad 上,它会在仅限 iPhone 的应用程序的“较小”视图中打开)。这是可能的,还是我必须更改构建目标或类似的内容?

感谢您提前提供的任何帮助。

I recently converted my iPhone app to be for iPad as well by right-clicking on the target and selecting "Upgrade Current Target for iPad". Then, every time I opened the app with the iPad simulator, it opens the newly created MainWindow-iPad.xib.

However, I ran into problems, so what I'd like to do is "downgrade" the iPhone app so it only runs the iPhone xib on the iPhone/iPad. (So when it runs on the iPhone, it runs normally, and on the iPad it opens in the "smaller" view for iPhone-only apps). Is this possible, or do I have to change the build targets or something along those lines?

Thanks for any help in advance.

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

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

发布评论

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

评论(1

傲鸠 2024-09-16 19:26:44

撤消 Xcode 所做的更改相当容易。查看应用程序的 Info.plist 文件,您应该会看到一个名为 NSMainNibFile~ipad 的条目。这就是导致加载 iPad 特定 NIB 文件的原因。如果您删除该条目,您应该会重新使用两个设备的 iPhone NIB 文件。

您可能还想将目标设备系列从 iPhone/iPad 更改回仅 iPhone。

It is fairly easy to undo the changes made by Xcode. Look at the Info.plist file for your app and you should see an entry named NSMainNibFile~ipad. This is what causes the iPad specific NIB file to be loaded. If you delete that entry you should be back to using the iPhone NIB file for both devices.

You may also want to change the Targeted Device Family from iPhone/iPad back to be just iPhone.

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