Reputation: 8449
I just like two buttons above each other with no margins. This seems like an easy task, but I am new to iOS and I wasted too much time now. I tried dozens of contraints but it never went out well. I always ended up with setting the leading Spaces to -24 and having marings above and beneath the buttons. I am using xcode6, iOS8.1 and storyboard. My app is landscape only. Can someone please teach me what to do?
The buttons should look like seen in this picture: Fullscreen, no margins and Button1 should reach unter the statusbar!
Upvotes: 0
Views: 209
Reputation: 4996
I'll outline the steps:
Pin
Button 1 to 0
spacing on Left, Right, TopPin
Button 2 to 0
spacing on Left, Right, BottomPin
heights equally
(You can access pin either from the Editor tool bar in the top menu, or from the second icon in the constraints area)
The thing with constraints and auto layout is that you only need enough constraints to let the app calculate where elements should be at all times. You might be able to get away with less constraints.
To get remove the borders, you need to change the button Type in IB from System
to Custom
, then you can drag and alter the margins to remove them. Following that you will need to update constraints on the buttons.
Upvotes: 2