How to develop or migrate apps for iPhone 5 screen resolution?

后端 未结 30 3230
醉话见心
醉话见心 2020-11-21 05:48

The new iPhone 5 display has a new aspect ratio and a new resolution (640 x 1136 pixels).

What is required to develop new or transition already existing applications

30条回答
  •  北荒
    北荒 (楼主)
    2020-11-21 06:20

    You can manually check the screen size to determine which device you're on:

    #define DEVICE_IS_IPHONE5 ([[UIScreen mainScreen] bounds].size.height == 568)
    
    float height = DEVICE_IS_IPHONE5?568:480;
    if (height == 568) {
        // 4"
    
    } else {
    
        // 3"
    
    }
    

提交回复
热议问题