Make an iPad app Universal?

不打扰是莪最后的温柔 提交于 2019-12-05 02:05:13

问题


I've seen lot's of questions asking how to convert iPhone apps into Universal apps, and the answer has usually been to use the Upgrade Target For iPad and sometimes update the Info.plist. I've also seen this question, which asks the same thing as me, but I'm looking for a different approach.

The answer posted there says that in order to convert an iPad app to a universal app, one must just change the Target device family and then code for it. I think that answer is incorrect, because you end up with a lopsided codebase.

How would I convert an iPad app to a universal app, so that the directory structure would look like an iPhone app that was upgraded? (Including steps such as editing the plist and splitting the delegate.)


回答1:


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.

Modify your info.plist to use those xibs for iPads (and icons, etc.)

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.

If you created new classes, plug them into the iPad xibs as needed.

Modify your Target settings to include building for iPad.

Move around, and/or rename your existing iPhone files/directories to make them symmetric, if so desired.




回答2:


This blog post is mentioned in one of the answers to the question that you referenced, but if you haven't read it already, it may be helpful:

http://iphonedevelopment.blogspot.com/2010/04/converting-iphone-apps-to-universal.html



来源:https://stackoverflow.com/questions/4382394/make-an-ipad-app-universal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!