为iOS8创建Launch Screen.xib(... iOS11,Swift 4和LaunchScreen.storyboard) [英] Creating Launch Screen.xib for iOS8 ( ... iOS11, Swift 4 and LaunchScreen.storyboard )

查看:504
本文介绍了为iOS8创建Launch Screen.xib(... iOS11,Swift 4和LaunchScreen.storyboard)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚发现,为了能够在应用商店中对您的应用进行描述,请说此应用针对iPhone 6和iPhone 6 Plus进行了优化。您需要为启动图像使用启动XIB或故事板文件(根据[Apple] [1])。

I've just found out that in order to be able to have the description for your app in the app store say "This app is optimized for iPhone 6, and iPhone 6 Plus." you need to use a launch XIB or storyboard file for your launch images (per [Apple][1]).

所以,我已经创建了一个新的Launch Screen xib,现在我有点但是因为我通常在代码中做所有事情并且不使用界面构建器。我删除了插入的默认标签,并将 UIImageView 放入视图中。现在我想知道我将如何:

So, I've created a new Launch Screen xib and now I'm a little but since I usually do everything in code and don't use interface builder. I've deleted the default label that is inserted and dropped a UIImageView into the view. Now I'm wondering how would I:

1)告诉 UIImageView 调整大小到任何屏幕的大小它在

1) Tell the UIImageView to resize to the size of whatever screen it's on

2)如果3.5英寸屏幕正在运行应用程序或者如果4英寸屏幕正在运行应用程序等,请告诉UIImageView选择ImageA等。

2) Tell the UIImageView to pick ImageA if a 3.5 inch screen is running the app or the ImageB if a 4 inch screen is running the app etc. etc.

基本上,我只是试图让启动.xib模仿启动屏幕正常工作的行为。如果有人能为此提供一些帮助,我将不胜感激!

Essentially, I'm just trying to get the launch .xib to mimic the behavior of how the launch screen works normally. Would appreciate it if anyone could provide some assistance on this!

推荐答案

您有两种选择:


  1. 您可以使用autolayout并为imageview提供全屏外观(距离顶部,底部,左侧和右侧等于0)。但是,这会导致某些屏幕尺寸的图像被削减,这可能是您不想要的。因此,您可能需要考虑(2)

  1. You make use of autolayout and give the imageview a fullscreen appearance (distance to top, bottom, left and right equals 0). This would however result in a clipping of the image for certain screen sizes, what you may not want. So you might want to consider (2)

将启动屏幕图像放入资产目录中,然后将不同的图像放入不同的大小类中。

You place the launch screen image into an asset catalog and just put different images into the different size classes.

这篇关于为iOS8创建Launch Screen.xib(... iOS11,Swift 4和LaunchScreen.storyboard)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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