宏定義,判斷是否高清屏

宏定義,判斷是否高清屏 ,ipad,simulator ,方法如下:






// 是否高清屏




#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)


發佈了74 篇原創文章 · 獲贊 1 · 訪問量 8萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章