#define PHONE_HEIGHT [[UIScreen mainScreen] bounds].size.height #define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) #if 0 //pad環境 #define SCREEN_WIDTH 576 #define SCREEN_HEIGHT 1024 #define IPAD_INDEX 96 #else //手機環境 #define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width #define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height #define IPAD_INDEX 0 #endif //屏幕適配 #define STANDARD_WIDTH 414.0 #define RATIO SCREEN_WIDTH /414.0 // 1.判斷是否爲iOS7 #define iOS7 ([[UIDevice currentDevice].systemVersion doubleValue] >= 7.0) if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { iPad端 }else { iPhone端 }