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

iOS Build a Playlist Browser with Swift Refactoring Our Code Adding Multiple Playlists

ImageView layout still not sized appropriately. Same constraints as Pasan applied...?

Assuming that all 6 ImageView constraints are identical to Pasan's, could there be any other reasons why they're not sizing appropriately on my iPhone 6? It seems as if the 157x165 heightxwidth constraints may be off.

Chris Howie
Chris Howie
13,216 Points

How are your images appearing in the preview of the app? Are the off-centered or simply off the page?

2 Answers

Heights and widths for all ImageViews are off. Widths are identical among tiles on the left, just as they're identical among tiles on the right. Right tile widths are ~1.5x left tile widths and stretch across the center.

Heights are largest among both bottom tiles, as the top four tile heights are a bit compressed. Looks like a height AND width problem to me. If you need to see a screenshot, let me know how I can post one in this forum.

Chris Howie
Chris Howie
13,216 Points

I believe that they should all be px apart from each other according to the video. Do you also have equal widths and heights set for both?

Also one thing that you could do which I do from time to time it download the project from the downloads option. This will allow you to compare your project to pasan's project to see what is different.

Let me know.

Thanks

Chris

Hey Chris, I downloaded the project file and took a good look. I had all of my tiles with height constraints of 165 and width constraints of 157, as opposed to "Equal Constraints." Not sure why that made the difference, if theoretically all tiles have the same height/width constraints and are both horizontally and vertically pinned to one another. Thoughts?

Chris Howie
Chris Howie
13,216 Points

As the display size changes the constraints will change as well. So setting equal constraints ensures that all objects change at the same time as the display size changes.