18
[UIScreen mainScreen] .bounds.sizeはiOS8で向きに依存しますか?
iOS 7とiOS 8の両方で次のコードを実行しました。 UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; BOOL landscape = (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight); NSLog(@"Currently landscape: %@, width: %.2f, height: %.2f", (landscape ? @"Yes" : @"No"), [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height); 以下は、iOS 8からの結果です。 Currently landscape: No, width: 320.00, height: 568.00 Currently landscape: Yes, width: …