userInterfaceIdiom始终指示iPhone [英] userInterfaceIdiom always indicate iPhone

查看:73
本文介绍了userInterfaceIdiom始终指示iPhone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将以下代码添加到AppDelegate:

I added the following code to AppDelegate:

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
    self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil];
    NSLog(@"iPhone found");
} else {
    self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil];
    NSLog(@"iPad found");
}

在iPad 2上运行时,userInterfaceIdiom始终等于UIUserInterfaceIdiomPhone。我的iPad 2是在iOS 6.1.3上运行。

The userInterfaceIdiom always equal to UIUserInterfaceIdiomPhone when running on iPad 2. My iPad 2 is running on iOS 6.1.3.

我无法找出问题所在。

任何帮助表示赞赏!

提前致谢!

推荐答案

目标设备应通用

这篇关于userInterfaceIdiom始终指示iPhone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆