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 trialJordan George
9,926 PointsHow does NSLayoutConstraint know what size the artwork should be?
I just figured that we would have to end up resizing the artwork but then was surprised to see it already done.
1 Answer
Drew Carver
5,189 PointsI believe what's happening is that since the UIImage object is being constrained to all 4 sides of the view, when we load the image into it, it's going to fill that entire area, without stretching the image. Thus it goes fully across the sides and top and doesn't stretch to the bottom (to maintain the aspect ratio of the image).
I couldn't find anything stating this specifically, so if anyone else has any input, feel free to chime in.
Abdulwahab Alansari
15,151 PointsAbdulwahab Alansari
15,151 PointsI was asking myself why the image didn't stretch to the bottom of the view.