IOS适配

• Default.png(图片尺寸为320x480):显示在非Retina-3.5英寸屏幕上(iPhone3G\iPhone3GS,屏幕分辨率为320x480)

• Default@2x.png(图片尺寸为640x960):显示在Retina-3.5英寸屏幕上(iPhone4\iPhone4s,屏幕分辨为640x960)

• Default-568h@2x.png(图片尺寸为640x1136):显示在Retina-4.0英寸屏幕上(iPhone5,屏幕分辨率为640x1136)

 

 

一、高度适配

iPhone5的尺寸是640x1136,iPhone4的尺寸是640x960,多出来的176px如何处理?
那么原先iPhone4的app程序都要如何去适配新的iPhone5界面呢??

答:以前不考虑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)];
以前固定的高度,现在需要自动获取了。

posted @ 2014-04-25 16:26  洒洒  阅读(3697)  评论(0编辑  收藏  举报