// 是否高清屏
#define isRetina ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)
// 是否iPad
#define isPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
// 是否模拟器
#define isSimulator (NSNotFound != [[[UIDevice currentDevice] model] rangeOfString:@"Simulator"].location)
宏定义 是否retina高清屏,判断当前设备
本文提供了用于检测设备类型(如iPhone高清屏、iPad、模拟器等)的宏定义代码示例。这些宏通过检查屏幕分辨率和设备标识来判断当前运行环境。
8310

被折叠的 条评论
为什么被折叠?



