Xcode Storyboard: constraints prevent me from putting space between objects on the stack

I am learning Swift and programming with Xcode right now. First of all, to get an idea of โ€‹โ€‹how things work, I am doing Apple's tutorial Get Started iOS App Development (Swift) .

I created the application exactly as described in the tutorial, but like me, I am unable to get the same result.

Following is Result: Apple Result

Below is the result: --- PICTURE 2 in comments ---

The problem is with the space between Label / TextBox / Button which is missing here in my version. I don't know why this is so. I did everything exactly the same as in the Apple tutorial. I did it twice, but I don't know what the problem is. could you help me? How can I get this space. Even adding additional constraints on elements inside the stack doesn't work. I just get the following result:

--- PICTURE 3 IN COMMENT ---

How do I add this space or what did I do wrong in the tutorial?

thanks for your help!

+3


source to share


2 answers


You can specify it in the attribute inspector. Take a look at the following pictures.

enter image description here



enter image description here

+3


source


You can play with the properties of the stack view, there is one property called spacing that should be the desired distance you want.



0


source







All Articles