Search code examples
iosiphonexcodeautolayoutconstraints

Xcode Storyboard: Constraints don't let me put space between objects in a stack


i'm learning Swift and programming with Xcode right now. First of all to get a impression of how everything works I'm doing the Apple Tutorial Start Developing iOS Apps (Swift).

I was building the App exactly how it is described in the tutorial but as i do, it isn't possible for me to get the same result.

Following should be the Result: Apple's Result

Following is the Result I get of: ---PICTURE 2 in Comments---

The Problem is the Gap between the Label / TextBox / Button that is not here in my Version. I don't know why it is so. I did everything exactly like in the Tutorial of Apple. I rechecked everything twice but i don't know what the fault is. Can you please help me? How do I get this gap. Even adding more Constraints for the Items inside of the Stack doesn't work. I just get following Result:

---PICTURE 3 IN COMMENTS---

How do i add this gap or what have I done wrong in the Tutorial?

Thx for your Help!


Solution

  • You can specify it in Attributes inspector. Take a look at the following photos.

    enter image description here

    enter image description here