Dealing with iPad Mini screen size

前端 未结 9 2182
栀梦
栀梦 2020-11-29 00:06

The new iPad Mini has a 7.9 inch screen size. Does it have a retina display? Will it automatically scale existing xibs and storyboards or do we have to create two versions o

9条回答
  •  时光取名叫无心
    2020-11-29 00:43

    If the iPad Mini and the non-retina iPad's are going to be the same screen size regardless, couldn't you use something like what is used to determine whether the device screen is an iPhone 5 or iPhone 4:

    #define IS_WIDESCREEN5 ( [ [ UIScreen mainScreen ] bounds ].size.height == 568 )
    #define IS_WIDESCREEN4 ( [ [ UIScreen mainScreen ] bounds ].size.height == 480 )
    

    So for iPad Mini, and non-retina iPad's, do:

    #define IS_PAD ( [ [ UIScreen mainScreen ] bounds ].size.height == 512 )
    

    and for retina iPad's do:

    #define IS_RETINA_PAD ( [ [ UIScreen mainScreen ] bounds ].size.height == 1024 )
    

    This should differentiate the two types of screens and bypass the need to pinpoint the exact model for scale purposes. The alternate method would be to use auto-layout, however I have a better feeling of control without it.

    I hope this helps with the second part of your question. Good luck :)

提交回复
热议问题