kodeco.com Forums

Video Tutorial: Introducing Stack Views Part 1: Your First Stack View

Learn the basics of stack views by building one using interface builder.

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3942-introducing-stack-views/lessons/1

Hello Sam

I am following the tutorials. And in this first one, appears to me that there is an error. If i run the arr in iPhone 5s images are diferent. On iPhone 6, all good.

I attached some images.

It looks to me as if you might need to reduce the Vertical Content Compression Resistance priority of the label so that it is lower than that of the two images.

I’m guessing that at the moment, the left-hand image is being squashed instead of the labels. You can change this by altering the Content Compressions Resistance Priorities.


Hi Sam,

I have some strange behavior with stack views with Xcode 7.3. If I download and open the “demo finished” and change the spacing in the stack view to 6 and back to 5, I get a Misplaced Views warning. The warning stays there even if I hit “Update Frames” or “Fix Misplacement”. Any ideas?
Thanks for help!

Hi knuxel,

Sorry for the delay in my reply. I’m sorry I don’t have any great ideas - there are strange things that happen with IB when you use custom views that give exactly these kinds of errors, but I don’t see how they could be appearing in this demo project.

Have you checked that the following are all configured correctly:

  • Content hugging priority on the label
  • Content compression resistance priority on the label
  • Stack view properties

If the runtime version renders correctly and doesn’t show any Auto Layout errors then I would suggest that this might be a bug in the Interface Builder integration.

Sorry I couldn’t be more helpful


I think that the problem comes from the need of auto layout configuration for the two image views.


I’m not quite sure I follow - the two images are being displayed at their intrinsic content size. Is that what you mean?


I have the same problem when deal with the AutoLayout , and the final project too . I google it but i don’t know what should do .