如何在 Xcode 中为 iOS 应用程序添加 iPhone 5 大屏幕支持?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12396143/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 20:04:32  来源:igfitidea点击:

How to add iPhone 5 large screen support to iOS apps in Xcode?

iosxcodeiphone-5

提问by Anton

Possible Duplicate:
How to deal with iPhone 5 screen size?

可能的重复:
如何处理 iPhone 5 的屏幕尺寸?

How can I add support for 4-inch iPhone 5 displays to an iOS app in Xcode?

如何在 Xcode 中为 iOS 应用程序添加对 4 英寸 iPhone 5 显示器的支持?

Is this even possible with the latest public Xcode release, v4.4.1?

使用最新的公共 Xcode 版本 v4.4.1 甚至可以做到这一点吗?

回答by Luca T

Add a new launch image named [email protected] to your project and it will work!

将名为 [email protected] 的新启动图像添加到您的项目中,它将起作用!

回答by AliSoftware

If your application is iOS6 only, the easiest way to make views that layout correctly in both 3.5-inch and 4-inch iPhone 5 designs is to use AutoLayoutin your XIBs to make them adapt their size automatically (See the WWDC'2012 video sessionsabout that). If your application must support versions prior to iOS6, then you can still use AutoResizingMaskson your views to make them resize themselves to adapt to both 3.5 and 4 inch screens.

如果您的应用程序仅适用于 iOS6,那么在 3.5 英寸和 4 英寸 iPhone 5 设计中正确布局视图的最简单方法是在您的 XIB 中使用AutoLayout使它们自动调整大小(请参阅WWDC'2012 视频会议关于那个)。如果您的应用程序必须支持 iOS6 之前的版本,那么您仍然可以使用AutoResizingMasks您的视图来使它们自行调整大小以适应 3.5 和 4 英寸屏幕。

Then for your application to support the 4-inch display and take the whole screen when launched on an iPhone 5, simply add a "[email protected]"launch image to your project. The simple presence of this launch image will make your application launch full-screen on iPhone 5 instead of having black bands at the top and bottom.

然后,为了让您的应用程序支持 4 英寸显示屏并在 iPhone 5 上启动时占据整个屏幕,只需将"[email protected]"启动图像添加到您的项目中即可。此启动图像的简单存在将使您的应用程序在 iPhone 5 上全屏启动,而不是在顶部和底部出现黑带。

回答by RelativeGames

Short answer : use the new launch image slot ( the Retina 4-inch ) one in XCode->Targets->Summary->iPhone/iPod Deployment Info

简短回答:在 XCode->Targets->Summary->iPhone/iPod Deployment Info 中使用新的启动图像插槽(Retina 4 英寸)

I have an OpenGL ES 2 app that despite all options I checked, nothing worked. Creating a new GLGame project adds black launch images for Retina 3.5 inch and Retina 4 inch. Despite every other comparison to project settings or .plist file I found nothing else to say "make it available for iPhone 5". I sure hope this changes in the future.

我有一个 OpenGL ES 2 应用程序,尽管我检查了所有选项,但没有任何效果。创建一个新的 GLGame 项目为 Retina 3.5 英寸和 Retina 4 英寸添加黑色启动图像。尽管与项目设置或 .plist 文件进行了所有其他比较,但我发现没有什么可说的“使其可用于 iPhone 5”。我当然希望这在未来有所改变。