将 iPhone/iPad 应用程序降级为仅限 iPhone 的 XIB
我最近通过右键单击目标并选择“升级 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
撤消 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.