IOS中获取屏幕尺寸_移动开发_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > 移动开发 > IOS中获取屏幕尺寸

IOS中获取屏幕尺寸

 2015/3/8 2:43:42  先秦苍狼  程序员俱乐部  我要评论(0)
  • 摘要://app尺寸,去掉状态栏CGRectappRect=[UIScreenmainScreen].applicationFrame;NSLog(@"%f,%f,%f,%f",appRect.origin.x,appRect.origin.y,appRect.size.width,appRect.size.height);//屏幕尺寸CGRectscreenRect=[UIScreenmainScreen].bounds;NSLog(@"%f,%f,%f,%f",screenRect.origin
  • 标签:iOS

class="p1">    

    //app尺寸,去掉状态栏

    CGRect appRect = [UIScreen mainScreen].applicationFrame;

    NSLog(@"%f, %f, %f,%f",appRect.origin.x, appRect.origin.y, appRect.size.width,appRect.size.height);

    

    //屏幕尺寸

    CGRect screenRect = [UIScreen mainScreen].bounds;

    NSLog(@"%f, %f, %f,%f",screenRect.origin.x, screenRect.origin.y, screenRect.size.width,screenRect.size.height);

    

    //装天栏尺寸

    CGRect statusRect = [[UIApplication sharedApplication] statusBarFrame];

    NSLog(@"%f, %f, %f,%f",statusRect.origin.x, statusRect.origin.y, statusRect.size.width,statusRect.size.height);

上一篇: IOS之沙盒(Sandbox)机制 下一篇: 没有下一篇了!
发表评论
用户名: 匿名