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

后端 未结 30 3237
醉话见心
醉话见心 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:11

    In a constants.h file you can add these define statements:

     #define IS_IPAD UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad 
     #define IS_IPHONE UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone
     #define IS_WIDESCREEN (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double)568) < DBL_EPSILON) 
     #define IS_IPHONE_5 (!IS_IPAD && IS_WIDESCREEN)
    

提交回复
热议问题