iOS 8 の所有権の境界では、UIScreen クラスがデバイスの向きを反映するようになりました。これを修正するには、境界の代わりにプロパティの新しい nativeBounds を使用できます。nativeBounds はピクセル単位で測定されます。では、....... 領域のピクセルにどのようなコードを入れたのでしょうか? (このコードは私の AppDelegate.m にあります)
[ [ UIScreen mainScreen ] respondsToSelector: @selector( nativeBounds ) ];
if (................... == 1334) {
UIStoryboard *iPhone6 = [UIStoryboard storyboardWithName:@"iPhone6" bundle:nil];
UIViewController *initialViewController =[iPhone6 instantiateInitialViewController];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]bounds]];
self.window.rootViewController = initialViewController;
[self.window makeKeyAndVisible];
}
または、nativeBounds に対してコード全体を間違って実装していますか?
screenBounds が機能しない...
CGRect screenBounds=[[UIScreen mainScreen] bounds];
if (screenBounds.size.height == 667) { //code }