iOS获取屏幕分辨率

+(NSString *)getScreenPix{


    NSString *screenPix = @"";

    //屏幕尺寸

    CGRect rect = [[UIScreen mainScreen] bounds];

    CGSize size = rect.size;

    CGFloat width = size.width;

    CGFloat height = size.height;


    //分辨率

    CGFloat scale_screen = [UIScreen mainScreen].scale;

    screenPix = [NSString stringWithFormat:@"%.0fx%.0f",width*scale_screen,height*scale_screen];

    return screenPix;

}

你可能感兴趣的:(iOS获取屏幕分辨率)