简体   繁体   English

在LaunchScreen.storyboard中设置不同的LaunchImage

[英]Setting different LaunchImage in LaunchScreen.storyboard

I've got a set of LaunchImages in various sizes in my Assets.xcassets folder. 我的Assets.xcassets文件夹中有一组各种尺寸的LaunchImages。 I've created it by right-clicking in Assets.xcassets -> App Icons & Launch Images -> New iOS Launch Image , and put all the differently sized images inside every box. 我已经通过右键单击Assets.xcassets -> App Icons & Launch Images -> New iOS Launch Image来创建它,并将所有大小不同的图像放入每个框中。

iPads with 9.7" (or more) screen size need to have a different launch image from the iPhones. 屏幕尺寸为9.7英寸(或更大)的iPad必须具有与iPhone不同的启动图像。

I've been using LaunchScreen.storyboard to display the LaunchImage, with proper constraints. 我一直在使用LaunchScreen.storyboard显示带有适当约束的LaunchImage。 But only the iPhone version is displayed on the Simulator (and badly strecthed out). 但是,只有iPhone版本显示在Simulator上(并且被严重拉出)。

我的LaunchScreen.storyboard

Is there any way to make iOS choose the proper LaunchImage from the set? 有什么方法可以使iOS从集合中选择适当的LaunchImage?

Apparently LaunchScreen.storyboard has issues with using .launchimage image sets, but not with .imageset extension. 显然, LaunchScreen.storyboard在使用.launchimage图像集时出现问题,但在使用.imageset扩展名LaunchScreen.storyboard没有问题。

I've resolved it by not using the .launchimage file in Assets.xcassets , but by creating a New Image Set , and then just using two resolution files, one for iPhones and one for iPads. 我通过不使用.launchimage中的.launchimage文件来解决此Assets.xcassets ,而是通过创建一个New Image Set ,然后仅使用两个分辨率文件来解决,一个用于iPhone,一个用于iPad。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM