Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS full screen background image for all screen sizes

Tags:

ios

swift

uiimage

I'm trying to set a background image for my app that will scale to fill the 4, 4.7, and 5.5 inch screens.

  • I'm working in XCode 6 with swift
  • I created a 640 x 1136 image, and pasted @1x, @2x, and @3x images in my images.xcasetts folder. I selected the 'scale to fill' mode for the image view.
  • I created a UIImage in the main.storyboard file for the 4 inch screen. This image fills the screen just fine when I build.
  • I think I've tried just about every combination of height / width / aspect ratio constraints with no luck.
like image 745
rcrusoe Avatar asked Dec 26 '14 01:12

rcrusoe


1 Answers

The 4 and 4.7 use @2x, 5.5 used @3x, please see the screenshot detail.

Screenshot

You can download the PDF that is the origin of this screenshot from Ugur Akdemir's Dribble.

like image 137
Allen Avatar answered Nov 14 '22 23:11

Allen