iPhone - 如何将 iPhone 专用应用程序转变为通用应用程序?
如何将 iPhone 专用应用程序转变为通用应用程序? 编辑:找到解决方案 如果您想要选择“将当前目标升级到 iPad”选项,则必须将目标设备系列设置为仅限 iPhone,而不是 iPad/iPhone。这对我有用!
how can i transform an iPhone only app to an universal application?
EDIT : FOUND SOLUTION
If you want to have the "Upgrade current target to iPad" option selected, you must have Target Device Family set to iPhone only, not iPad/iPhone. It works for me!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想手动执行此操作,请首先创建一个虚拟/模板通用应用程序,查看它与您的应用程序之间的差异,然后更改您的应用程序以消除这些差异。步骤如下:
创建 iPad 子目录。
在该子目录中为 iPad 创建合适的 xib。 Interface Builder 有一个菜单项可以自动转换通用 .xibs。
修改您的 info.plist(添加 NSMainNibFile~ipad 键)以将 iPad xib 用于 iPad 主窗口。还要向此 plist 添加适当的图标等。
为 iPad 创建新的子类,或者使用修改现有子类来检查 UI 范例并选择适当的 UI 子元素和子类。代码中的大小。您可以使用以下方法签入代码:
如果您创建了新类,请根据需要将它们插入 iPad xib。
修改所有 Target 设置以针对 iPad 和 iPhone 进行构建。
If you want to do it manually, first create a dummy/template Universal app, look at the differences between it and your app, and change your app to eliminate those differences. Among the steps:
Create iPad subdirectories.
Create suitable xibs for the iPad in that subdirectory. Interface Builder has a menu item to convert generic .xibs automatically.
Modify your info.plist (add the NSMainNibFile~ipad key) to use an iPad xib for the iPad main window. Also add appropriate icons, etc. to this plist.
Either create new subclasses for the iPad, or use modify your existing subclasses to check the UI paradigm and select the appropriate UI subelements & sizes in code. You can check in code using something like:
If you created new classes, plug them into the iPad xibs as needed.
Modify all your Target settings to build for iPad and iPhone.
“第一步是在 Xcode 中选择您的目标,右键单击并使用“升级 iPad 的当前目标...”命令。您将看到一个选择:
选择“一个通用应用程序”,Xcode 将为我们完成(一些)艰苦的工作。Apple 指南警告不要尝试手动迁移目标,尽管说实话很难真正明白为什么。另请注意,如果您的项目有多个目标,您只能运行一次升级任务,您将需要检查所有目标并自行调整构建和 Info.plist 设置。
http://useyourloaf。 com/blog/2010/4/7/converting-to-a-universal-app-part-i.html
"The first step is to select your target in Xcode, right-click and use the “Upgrade Current Target for iPad…” command. You will presented with a choice:
Select “One Universal application” and Xcode will do (some) of the hard work for us. The Apple guidelines warn against trying to manually migrate your target though to be honest it is hard to really see why. Also note that if your project has more than one target you can only run the upgrade task once. You will need to check all of your targets and adjust the build and Info.plist settings yourself."
http://useyourloaf.com/blog/2010/4/7/converting-to-a-universal-app-part-i.html