我的團隊針對不同的iOS屏幕(例如iPad,iPad Mini,iPod,iPhone)執行不同的屏幕設計。是否有一種通用的方法可以完成支持/適合所有屏幕的單一設計。目前,我們在不同設備和應用的不同版本上面臨更多問題。上面提到的是完全原生的iOS應用程序。不是手機/不是鈦。iOS通用屏幕設計
這就是我們如何完成不同設備的編碼。
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
if([UIScreen mainScreen].bounds.size.height == 568)
{
HelpView.frame=CGRectMake(7, 0, 300, finalheight+30);
himgview.frame=CGRectMake(7, 560, 300, finalheight+30);
}
else if([UIScreen mainScreen].bounds.size.height==480){
HelpView.frame=CGRectMake(0, 0, 310, finalheight+30);
himgview.frame=CGRectMake(5, 555, 310, finalheight+30);
}
}
else{
if([UIScreen mainScreen].bounds.size.height == 568)
{
HelpView.frame=CGRectMake(7, 0, 300, finalheight+30);
himgview.frame=CGRectMake(7, 550, 300, finalheight+30);
}
else if([UIScreen mainScreen].bounds.size.height==480){
HelpView.frame=CGRectMake(0, 0, 310, finalheight+30);
himgview.frame=CGRectMake(5, 555, 310, finalheight+30);
}
}
你的意思是不同的屏幕設計?它看起來不同?或者只是爲相應的設備創建不同的筆尖? – Mani
不同尺寸 –
在IOS中,有一些不同的屏幕(尺寸),iPhone視網膜3.5「,視網膜4」,iPad,iPad mini。所以你可以相應地爲iPad和iPhone使用兩個不同的xib。爲了適應視網膜3.5「和4」,使用Autolayout。如果你的觀點更復雜,也可以使用另一個xib。 – Mani