iOS 6应用程序 - 如何处理iPhone 5的屏幕尺寸?
我只是想知道如何处理iPhone 5更大的屏幕尺寸。
I was just wondering with how should we deal with the iPhone 5 bigger screen size.
因为它有更多像素的高度,像GCRectMake这样使用坐标(只是将视网膜/非视网膜问题的像素加倍)将无法在版本之间无缝地工作,就像我们得到 Retina 。
As it has more pixels in height, things like GCRectMake that use coordinates (and just doubled the pixels with the retina/non retina problem) won't work seamlessly between versions, as it happened when we got the Retina.
我们是否必须设计两个故事板,就像iPad一样?
And will we have to design two storyboards, just like for the iPad?
我个人认为Apple不会要求你每次画画时都要检查屏幕尺寸,就像许多答案所说的那样。这会发生在iPad上吗?
I personally don't think Apple will require you to check the screen size every time you have to draw something, like many answers say. Does that happen with the iPad?
所有应用程序将继续在垂直拉伸的屏幕上工作,从我今天的演示文稿中可以看出。它们将是letterboxed或基本上额外的88点高度只是黑色。
All apps will continue to work in the vertically stretched screen from what I could tell in today's presentation. They will be letterboxed or basically the extra 88 points in height would simply be black.
如果你只打算支持iOS 6+,那么一定要考虑使用自动布局。它删除了所有固定的布局处理,而是使用约束来解决问题。没有什么是硬编码的,你的生活将会变得更加简单。
If you only plan to support iOS 6+, then definitely consider using Auto Layout. It removes all fixed layout handling and instead uses constraints to lay things out. Nothing will be hard-coded, and your life will become a lot simpler.
但是,如果你必须支持较旧的iOS,那么它实际上取决于你的应用程序。大多数使用标准导航栏和/或标签栏的应用程序可以简单地扩展中间的内容以消耗额外的点数。设置中心内容的自动调整遮罩以在两个方向上展开。
However, if you have to support older iOS's, then it really depends on your application. A majority of applications that use a standard navigation bar, and/or tab bar, could simply expand the content in the middle to use up that extra points. Set the autoresizing mask of the center content to expand in both directions.
view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
如果您的应用使用了像素完美的布局,它可以很好地开箱即用于表格视图为了显示内容,那么你最好的选择是重新设想内容,以便它可以适应不同的高度。
It works great out of the box for table views, however, if your app used pixel-perfect layout for displaying content, then your best bet would be to re-imagine the content so that it can accommodate varying heights.
如果这不可能,那么唯一剩下的选择是有两个用户界面(iPhone 5和iPhone 5之前)。
If that's not a possibility, then the only remaining option is to have two UIs (pre iPhone 5, and iPhone 5).
如果这听起来很难看,那么你可以使用默认的letterboxed模型,其中加分/像素只显示黑色。
If that sounds ugly, then you could go with the default letterboxed model where the extra points/pixels just show up black.
修改
使您的应用能够与之配合使用iPhone 5,你需要添加一个视网膜版本的启动器图像。它应该命名为 Default-568h@2x.png
。它必须是视网膜质量 - 这里没有向后兼容性:)
To enable your apps to work with iPhone 5, you need to add a retina version of the launcher image. It should be named Default-568h@2x.png
. And it has to be retina quality - there's no backward compatibility here :)
你也可以在Xcode中选择这个图像。转到目标,然后在摘要部分下,查找启动映像。图像的大小必须为640x1136像素。这是一个截图,找到它的位置,如果有帮助。
You could also select this image from within Xcode. Go to the target, and under the Summary section, look for Launch Images. The image has to be 640x1136 pixels in size. Here's a screenshot of where to find it, if that helps.