我的团队针对不同的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