Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Setting Background Images for Various Screen Sizes

In the video for "setting background images for various screen sizes" Ben shows us how to programatically set the background image for the 4 inch iPhone.

Why don't we just change the ImageView in the storyboard to fit the 4 inch screen, and then change the image 'mode' to 'aspect fill'? It seems to achieve the exact same result minus all the code, am I missing something here?

2 Answers

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

The image view does not resize itself at runtime. So if you size it for the 4" screen it will get cut off in a 3.5" screen. Ben is showing you the right way to do it.

I see, thanks Amit