【发布时间】:2014-10-10 01:19:47
【问题描述】:
我有一个加载表格视图的 UINavigationController。单元将详细视图控制器推送到屏幕上。现在我的应用程序变得通用了,我对如何在 iPad 上使用 UISplitViewController 感到困惑。
Apple 推荐的在 iPad 上为 iPhone UINavigationController 实现 UISplitViewController 的方法是什么?代码如何知道它应该在 iPad 上加载 UISplitViewController 而在 iPhone 上忽略它?
这是我在guide 中找到的:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// The device is an iPad running iOS 3.2 or later.
}
else {
// The device is an iPhone or iPod touch.
}
但是,这真的是有条件地加载 iPad UI 与 iPhone UI 的方式吗? 我不使用 IB 或 Nibs。
【问题讨论】:
-
此链接可能有帮助。 here
标签: ios ios7 uinavigationcontroller uisplitviewcontroller