Xcode 7.1 iPad PRO 模拟器拉伸 iPad Air 2 应用程序?
Xcode 7.1 iPad PRO simulator stretching iPad Air 2 app?
今天我从 Xcode 7.0.1 更新到 7.1.1 只是为了 iPad Pro 模拟器。 iPad Pro 分辨率与所有其他 iPads 不同,所以 iPad Pro 模拟器是否只是扩展我的游戏以适应 iPad Pro? iPad Pro 模拟器,我的应用程序虽然看起来很棒,但没有拉伸外观。我很困惑,模拟器只是在播放 iPad Air 2 的扩展版本,还是如果我使用 iPad Pro 设备和 运行 应用程序,我也会看到一个完美的已安装 iPad Pro 应用程序 运行ning?
iPad PRO 正在从 iPad AIR、iPad AIR 2 和 iPad RETINA 模拟器中加载代码
对于仍然遇到上述问题的任何人,这里是我找到的解决方案:
在AppDelegate.m中,在应用didFinishLaunchingWithOptions代码中,使用如下代码:
if (([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && [UIScreen mainScreen].bounds.size.height == 1366))
{
UIStoryboard *iPadPRO = [UIStoryboard storyboardWithName:@"iPadPRO" bundle:nil];
UIViewController *initialViewController =[iPadPRO instantiateInitialViewController];
self.window.rootViewController = initialViewController;
[self.window makeKeyAndVisible];
}
else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] && [[UIScreen mainScreen] scale] == 2){
UIStoryboard *iPadRetina = [UIStoryboard storyboardWithName:@"iPadRetina" bundle:nil];
UIViewController *initialViewController =[iPadRetina instantiateInitialViewController];
self.window.rootViewController = initialViewController;
[self.window makeKeyAndVisible];
}
今天我从 Xcode 7.0.1 更新到 7.1.1 只是为了 iPad Pro 模拟器。 iPad Pro 分辨率与所有其他 iPads 不同,所以 iPad Pro 模拟器是否只是扩展我的游戏以适应 iPad Pro? iPad Pro 模拟器,我的应用程序虽然看起来很棒,但没有拉伸外观。我很困惑,模拟器只是在播放 iPad Air 2 的扩展版本,还是如果我使用 iPad Pro 设备和 运行 应用程序,我也会看到一个完美的已安装 iPad Pro 应用程序 运行ning?
iPad PRO 正在从 iPad AIR、iPad AIR 2 和 iPad RETINA 模拟器中加载代码
对于仍然遇到上述问题的任何人,这里是我找到的解决方案:
在AppDelegate.m中,在应用didFinishLaunchingWithOptions代码中,使用如下代码:
if (([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && [UIScreen mainScreen].bounds.size.height == 1366))
{
UIStoryboard *iPadPRO = [UIStoryboard storyboardWithName:@"iPadPRO" bundle:nil];
UIViewController *initialViewController =[iPadPRO instantiateInitialViewController];
self.window.rootViewController = initialViewController;
[self.window makeKeyAndVisible];
}
else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] && [[UIScreen mainScreen] scale] == 2){
UIStoryboard *iPadRetina = [UIStoryboard storyboardWithName:@"iPadRetina" bundle:nil];
UIViewController *initialViewController =[iPadRetina instantiateInitialViewController];
self.window.rootViewController = initialViewController;
[self.window makeKeyAndVisible];
}