Wilson
Wilson

Reputation: 9136

What sizes for @3x, @2x, etc should I provide for an Image inside LaunchScreen.storyboard?

I have the UIImageView pinned to all the borders of the LaunchScreen.storyboard:

enter image description here

I am using Assets.xcassets for providing the image to the UIImageView:

enter image description here

I would like that launchscreen's image to be shown properly on iPhone 5, 5S, 6, 6S, 7.

I am not sure what sizes I should make for the Image.

Thanks!

Upvotes: 5

Views: 2018

Answers (1)

alexburtnik
alexburtnik

Reputation: 7741

First approach:

You can use LaunchImage in your assets catalog to add images for every screen resolution you support. Also you can check screen resolution for all devices here.

enter image description here

After you add your images select them here:

Your target -> General -> App Icons and Launch Images section -> Launch Images Source

Second approach:

If for some reason you don't want to use static images and prefer to have LaunchScreen.storyboard with UIImageView, you can just add the biggest resolution for each scale (1x, 2x, 3x):

1x -> iPhone 4: 320x480

You don't need this image if you don't support iOS 7 and lower.

2x -> iPhone 6/6s: 750 x 1334

Yes, you have other devices with different resolution:

  • 5/5s (640 x 1136) - image will be downscaled
  • 4s (640x960) - use Aspect Fill content mode for your image view and it will crop top and bottom

3x -> iPhone 6 plus: 1242 x 2208

Upvotes: 4

Related Questions