iOS获取当前屏幕的尺寸和分辨率

//1、得到当前屏幕的尺寸:
CGRect rect_screen = [[UIScreen mainScreen] bounds];
CGSize size_screen = rect_screen.size;

//2、获得scale:iPhone5和iPhone6是2,iPhone6Plus是3
CGFloat scale_screen = [UIScreen mainScreen].scale;
NSLog(@"scale_screen:%.f", scale_screen);

//3.获取当前屏幕的分辨率
CGFloat widthResolution = size_screen.width * scale_screen;
CGFloat heightResolution = size_screen.height * scale_screen;

 

上一篇:众筹网_管理员信息维护


下一篇:PagedList