iphone5頁面適配修改

1.須要添加一張啓動圖片,大小:640*1136,添加後默認命名爲Default-568h@2x.png。圖片適配,對於高清的1136圖片,命名一樣使用@2x,只是更名圖片名稱,如image-1-os5.png,image-1-os5@2x.png,在代碼中判斷iphone5?(image-1):(image-1-os5),沒有@22x這種。 iphone

#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)

2.iphone5的View爲568,減去Nav(44)+任務欄(20),爲504,相比iphone4s及之前版本的480,減去Nav+任務欄,爲416,高出88(差異). 佈局

3.代碼修改: spa

  (1).iphone5中,須要修改的值就是y、height,根據具體的差異。簡單的修改View‘s height: code

view.frame = CGRectMake(0, 0, 320, 416+(iphone5?88:0))

  y修改相似。 圖片

  (2).Controller初始化: ip

AViewController *aViewContrller = [[AViewController alloc] initWithNibName:(iPhone5?@"AViewController-5":@"AViewController") bundle:nil];

4.XIB修改: it

  (1).View、Tableview等界面,直接修改Autosizing屬性,使其上下拉伸。 select

  (2).部分沒法修改的View(如view內增長了2個固定大小的view),須要建立一個新的XIB文件(假設AController-5.xib),添加View並在Simulated Metrics中設置Size爲Retina 4 Full Screen,而後根據固定的位置從新佈局,再使用第3部分(2)。 command

 

5.其餘部分: im

  1.UITableView默認分組表背景若是須要改成白色,須要去掉BackgroundView。

  2.旋轉須要修改CGRect的X。

  3.passbook部分介紹。

  4.模擬器home快捷鍵:shift+command+H。

  5.待補充。

  6.浮動的一些篩選項,儘可能使用Nav的push打開,避免修改尺寸。

相關文章
相關標籤/搜索