我知道了,如何判断是iPhone还是iPad
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
我知道构建通用应用程序的两种方法:
1) 使用一个 Controller 控制 2 个 xib (iPhone/iPad)
2)为 iPad 和 iPhone 使用不同的 View Controller
最好的方法是什么?
最佳答案
适用于 iPhone 和 iPad 的相同 View Controller ,但使用 UIUserInterfaceIdiom
作为 switch case 以避免创建重复的 View Controller (具有相同的内容)。
不过,您可以为 iPhone 和 iPad 使用不同的 XIB。
关于iphone - 通用 iPhone/iPad 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12579601/