• Default.png(图片尺寸为320x480):显示在非Retina-3.5英寸屏幕上(iPhone3G\iPhone3GS,屏幕分辨率为320x480)app
• Default@2x.png(图片尺寸为640x960):显示在Retina-3.5英寸屏幕上(iPhone4\iPhone4s,屏幕分辨为640x960)iphone
• Default-568h@2x.png(图片尺寸为640x1136):显示在Retina-4.0英寸屏幕上(iPhone5,屏幕分辨率为640x1136)图片
1、高度适配ip
iPhone5的尺寸是640x1136,iPhone4的尺寸是640x960,多出来的176px如何处理?
那么原先iPhone4的app程序都要如何去适配新的iPhone5界面呢??it
答:之前不考虑iphone5的时候,咱们写一个页面最下方的UIButton。会这么写:
UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 460-44, 320, 44)];
如今考虑iphone5的长屏幕,就须要这么写:
UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height-44, 320, 44)];
之前固定的高度,如今须要自动获取了。程序