iPhone 6是一个不同的故事板? [英] iPhone 6 a different storyboard?
问题描述
当我们有 iPhone 4和5
时,我们检查了屏幕尺寸,并为每部iPhone制作了2个故事板。
When we had the iPhone 4 and 5
, we checked the screen size, and made 2 storyboards for each iPhone.
//iPhone 4
if (height == 480)
{
storyboard = [UIStoryboard storyboardWithName:@"StoryboardiPhone" bundle:nil];
NSLog(@"Device has a 3.5inch Display.");
}
//iPhone 5
else if (height == 568)
{
storyboard = [UIStoryboard storyboardWithName:@"StoryboardiPhone5" bundle:nil];
NSLog(@"Device has a 4inch Display.");
}
//iPads
else
{
storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
NSLog(@"Device has a iPad Display ");
}
现在还有2个iPhone,问题是,是适用于所有iPhone和iPad的 5 故事板
是正确的吗?在我看来这是一件错误的事情,但是我找不到一种方法来在一个设备中安排视图,并使其适合所有其他设备 - 并确保始终工作得很好。
Now there are 2 more iPhones, the question is, is it right to make 5 storyboards
for all iPhones and iPad ? seems to me a wrong thing to do, but i couldn't find a way to arrange the views in one device, and make it fit the all the others -and be sure that it always works great.
现在什么是正确的方法?
What will be the right approach right now ?
推荐答案
否,你应该使用 AutoLayout 并写下来适当的约束,让系统调整各种大小的UI。
No, you should use AutoLayout and write the appropriate constraints and let the system resize your UI for the various sizes.
这篇关于iPhone 6是一个不同的故事板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!