iOS Writing Macro detect 3.5 inch or 4 inch display [duplicate]

喜你入骨 提交于 2019-12-03 02:02:16
Nitin Gohel

you can detect iphopne 3.5 inch or 4 inch using bellow:-

#define isiPhone5  ([[UIScreen mainScreen] bounds].size.height == 568)?TRUE:FALSE

you can check it using bellow method for example:-

     if (isiPhone5)
     {
           // this is iphone 4 inch
     }
     else
     {

           //Iphone  3.5 inch
     }

Please take a look of this link for you knew all about Macro for determine the device is 3.5 inch or 4 inch.

How to detect iPhone 5 (widescreen devices)?

Mean something like this:

#define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES)

you can check if it is iphone 5 (4 inch) like this:

The iPhone 5's screen has a height of 568.

if ([ [ UIScreen mainScreen ] bounds ].size.height == 568)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!