iOS 如何获取屏幕大小

     UIScreen *currentScreen = [UIScreen  mainScreen];

     NSLog(@"applicationFrame.size.height = %f",currentScreen.applicationFrame.size.height);

     NSLog(@"applicationFrame.size.width = %f",currentScreen.applicationFrame.size.width);

     NSLog(@"applicationFrame.origin.x = %f",currentScreen.applicationFrame.origin.x);

     NSLog(@"applicationFrame.origin.y = %f",currentScreen.applicationFrame.origin.y);

     NSLog(@"bounds.x = %f",currentScreen.bounds.origin.x);

     NSLog(@"bounds.y = %f",currentScreen.bounds.origin.y);

     NSLog(@"bounds.height = %f",currentScreen.bounds.size.height);

     NSLog(@"bounds.width = %f",currentScreen.bounds.size.width);

     NSLog(@"brightness = %f",currentScreen.brightness);

更新:

iOS 9 之后:使用 [UIScreen  mainScreen].bounds代替 [UIScreen  mainScreen].applicationFrame

上一篇:2018面向对象程序设计(Java)第17周学习指导及要求


下一篇:POJ2478 - Farey Sequence(法雷级数&&欧拉函数)