`

APP适配iphone5 and ihpone4

阅读更多

首先加入Default-568@2x.png得开机图片

CGFloat screenWidth = [[UIScreen mainScreen] bounds].size.width;

CGFloat screenHeight = [[UIScreen mainScreen] bounds].size.height;

iphone4模拟器得到得结果是:320 480

iphone5模拟器得到得结果是:320 568

 

判断是否为iphone5

#define IS_IPHONE_5     ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )

返回一个bool值

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics