iOSの解像度メモ
最近iPhone6/6 Plus対応をするためにちょくちょく参照していたのでメモ。
インチ | デザイン時参照 | コーディング時参照 | 端末 |
3.5 | 960x640 | 480x320 | iphone4, 4s |
4.0 | 1136x640 | 568x320 | iphone5, 5s |
4.7 | 1334x750 | 667x375 | iphone6 |
5.5 | 2208x1242 (1920x1080) | 736x414 | iphone6 plus |
ipad | 1024x768 | 1024x768 | ipad mini |
ipad retina | 2048x1536 | 1024x768 | ipad |
機種判定用マクロ
#define SCREEN_SIZE [UIScreen mainScreen].bounds.size #define IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) #define IPAD_RETINA (IPAD && [[UIScreen mainScreen] scale] == 2.0) #define IPHONE_35 (SCREEN_SIZE.width == 320 && SCREEN_SIZE.height == 480) || (SCREEN_SIZE.width == 480 && SCREEN_SIZE.height == 340) #define IPHONE_40 (SCREEN_SIZE.width == 320 && SCREEN_SIZE.height == 568) || (SCREEN_SIZE.width == 568 && SCREEN_SIZE.height == 340) #define IPHONE_47 (SCREEN_SIZE.width == 375 && SCREEN_SIZE.height == 667) || (SCREEN_SIZE.width == 667 && SCREEN_SIZE.height == 375) #define IPHONE_55 (SCREEN_SIZE.width == 414 && SCREEN_SIZE.height == 736) || (SCREEN_SIZE.width == 736 && SCREEN_SIZE.height == 414)