Questions tagged «uiscreen»

14
检测视网膜显示
iOS SDK是否提供一种简便的方法来检查currentDevice是否具有高分辨率显示器(视网膜)? 我发现现在最好的方法是: if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] == YES && [[UIScreen mainScreen] scale] == 2.00) { // RETINA DISPLAY }

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: …

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.