how to insert an image for the launchscreen.storyboard

Hello,

I try to add an image for launchscreen.storyboard I add UIImageView in launchscreen.storyboard and now I would like to add an .png image.

I tried to drag and drop but it doesn't work.

How can I do ?


PS : I have xcode 10, and it is iOS development.

Replies

Drag/drop from where, to where, exactly? Finder to storyboard, resource column to asset catalog? ...?

I just did it:

- add an UIImageView in launchScreen (IB)

- set its image to some .png image that is in Assets.xcassets


it works OK.


XCode 10.3

Simulator.


So check you have put the image in Assets.xcassets.

I took a look to to Assets.xcassets and nothing allow me to change the launchscreen image which can have a different size depending of the device on which the app runs.

I have no solution at the moment.

I try to put a launchscreen image, but I don't know how to do.

Somebody can help me ?

I may not understand your point:


I took a look to to Assets.xcassets and nothing allow me to change the launchscreen image which can have a different size depending of the device on which the app runs.


The change in size will not be done in xcassets.

It should be done through approriate constraintes in IB and a scale to fit setting.

The launchscreen image asset catalog item is an older technology that isn't used any more.


Instead, use an ordinary image asset catalog item to get the image into your app. Then, as Claude said, you will be able to choose that image's name in your UIImageView's properties.

Excuse me to ask this but "how do I access to UIImageView's properties" ?

In Interface Builder, as I proposed, you should insert an ImageView.


Then, in the ImageView properties (via the Attributes Inspector), select the image to display (first field at top.