扩展iPhone 5的应用程序 - 最佳实践 [英] Extend app for iPhone 5 - best practice

查看:110
本文介绍了扩展iPhone 5的应用程序 - 最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在 Apple 即将开始发售iPhone 5,我正在寻求扩展我的应用程序,以便它们在 iPhone 5 上全屏显示。我在模拟器上运行我的应用程序,甚至那些 UITableView 延伸到屏幕底部的应用程序,黑条显示在屏幕的顶部和底部。

Now that Apple is about to start shipping iPhone 5's, I'm looking into extending my applications so they appear full screen on the iPhone 5. I ran my apps on the simulator, and even the ones with a UITableView extending to the bottom of the screen, the black bars appear at the top and bottom of the screen.

以下是我的问题:为 iPhone 5 扩展应用的最佳做法是什么?

Here's my question: What is the best practice for extending apps for the iPhone 5?

我现在应该为 3.5 4 英寸屏幕创建一个单独的笔尖,还是扩展代码中的所有内容?

Should I make a separate nib now for the 3.5 and 4 inch screen, or extend everything in code?

我正在尝试尽可能顺利地进行转换,所以我呼吁SO的知识让我知道为两者构建最好的方法屏幕。

I'm trying to make this as smooth a transition as possible, so I appeal to knowledge of SO to clue me in onto what the best way is to build for both screens.

推荐答案

利用应用中的完整4屏幕似乎就像添加一个名为的新默认图像一样简单 Default-568h@2x.png ,尺寸为640 x 1136.Xcode 4.5实际上会为您自动添加适当尺寸和名称的黑色图像。项目。

Taking advantage of the full 4" screen in your apps seems to be as simple as adding a new Default image named Default-568h@2x.png with size 640 x 1136. Xcode 4.5 will actually offer to do this for you automatically by adding a black image of the proper size and name to your project.

对于使用标准UI组件的应用程序,例如表格视图,这些表格被神奇地扩展以填充屏幕。我更新了一个应用程序用于工作,它实际上是字面意思这很简单,只有几个与我自己的代码和UI设置相关的小问题。但总而言之,非常简单。

For apps that use standard UI components, such as table views, the tables are magically extended to fill the screen. I updated an app for work and it was literally this simple, with only a couple minor issues related to my own code and UI setup. But all in all, very easy.

将此与我工作的其他应用程序对比(对于我来说,除了UIViews之外,它没有使用任何标准UI组件。为了处理3.5和4屏幕,我ave不得不花费相当多的时间来重构需要了解应用程序各种操作的屏幕大小的代码。 (在这种情况下,应用程序更像是游戏/模拟器,而不是生产力应用程序。)

Contrast this with another app I work on (for myself), which uses none of the standard UI components except for UIViews. To deal with both 3.5" and 4" screens, I have had to spend quite a bit of time refactoring code that needs to know screen size for various operations of the app. (The app in this case is more of a game/simulator than say, a productivity app.)

因此,您的里程可能会因努力程度而异em>真的需要支持4屏幕。这将取决于你的应用程序有多复杂和非标准,正如我发现的那样。

So, your mileage may vary with regard to the level of effort really required to support the 4" screen. It will depend on how complicated and "non-standard" your app is, as I have discovered.

这篇关于扩展iPhone 5的应用程序 - 最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆