0

I am new to Stack Views so bear with me. I have an outer Stack View that contains all my elements as displayed in the image:

enter image description here

My problem is that the "Skip" button is now outside its container. I have tried to set constraints for "Center Horizontally" and "Center Vertically", but this causes my image to look like this:

enter image description here

As we can see, both my button and my container are no longer appearing in the Scene. What am I doing wrong here?

Here are my constraints for my container: enter image description here

Here are my constraints for my "Skip" button: enter image description here

ML.
  • 589
  • 1
  • 9
  • 33

2 Answers2

3

Stack views essentially work on the principle of stacking objects which will obviously remove the prior constraints. The previous answer is correct but does not take into consideration stack views as asked by the question.

The simplest fix would to essentially "group" your button and image by placing them in a view and then adding the view into the stack view.

0

I found a solution by first putting all the other elements in the Stack View first, then I put the button and its container in a View, and then I dragged and dropped the View into the Stack View.

ML.
  • 589
  • 1
  • 9
  • 33