APP适配iphone5 and ihpone4

首先加入[email protected]得开机图片

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值

猜你喜欢

转载自lijinfengjava.iteye.com/blog/1744443
今日推荐