LaunchScreen不适用于不同的设备

时间:2016-08-07 15:29:54

标签: ios swift storyboard

说明

我试图让我的LaunchScreen.storyboard适用于从iPhone 4到iPad Pro的每台设备。这样,我创建了3个分辨率图像:

launchScreen @ 3x = 1366x1024(iPad Pro /最大尺寸)
launchScreen @ 2x = 911x683(1366 * 2/3 x 1024 * 2/3)
launchScreen = 455x341(1366 * 1/3 x 1024 * 1/3)

但是当我将它们添加到项目中并添加缺失的约束时,他们将无法正常工作,如下所示。

enter image description here

我知道我做错了什么,但我不知道是什么。我在很多地方搜索过,但找不到任何东西。我有什么办法可以做到这一点吗?


提前谢谢,
路易斯。

1 个答案:

答案 0 :(得分:2)

首先,如果从图像视图中删除所有约束。

之后,将imageView内容模式设置为Scale To Fill

然后像这样约束你的imageView

enter image description here

你的结果将是:

enter image description here

here是您获取更多信息的示例代码。