如何判断ios设备是否是高清屏幕

时间:2023-01-27 20:22:04
if([[[UIDevice currentDevice] systemVersion] floatValue] >= 3.2f)
{
CGRect winRect = [[UIScreen mainScreen] bounds];
CCLOG("winRect w = %f, h = %f", winRect.size.width, winRect.size.height);
CGSize winSize = [[UIScreen mainScreen] currentMode].size;
CCLOG("currentModeSize w %f h%f", winSize.width, winSize.height);
bool isRetina =
[UIScreen instancesRespondToSelector:@selector(currentMode)] ?
CGSizeEqualToSize(CGSizeMake(winRect.size.width*2, winRect.size.height*2), winSize)
||CGSizeEqualToSize(CGSizeMake(winRect.size.height*2, winRect.size.width*2), winSize)
: FALSE;
}

//判断设备是否是高清设备