首页 > 学院 > 开发设计 > 正文

IOS中获取屏幕尺寸

2019-11-14 19:29:20
字体:
来源:转载
供稿:网友

    

    //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);


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表