So I've be studying Swift/iOS development recently and I'm having a little trouble with sizing buttons within a stack view, I have the following layout:
There are two TextFields and a button in a vertical StackView, the StackView is centred horizontally and vertically(with a bit of spacing). It's anchored width ways to the left and right margin.
I wanted to reduce the size of the button so it's about 80% of the width of the StackView.
Things I've tried:
- Adding a constraint to width of the button, this causes conflicts with the StackView.
- Adding a sub StackView and then trying to set it's left/right anchor constraint to 20 with the thought that it'd give it a bit of margin. Again this causes conflicts with the outer stackview.
I'm doing all this in the storyboard view rather than in code as I was trying to get to know the interface.
I've had a good hunt through and can't seem to find any answers that apply, apologies if it seems basic but thought it might be beneficial on the off chance anybody else new to Xcode/Swift comes across this.