I'm new to Swift and trying to repeat the calculator app as part of the learning, but got stuck at the autolayout.
Here's what I did:
- Set each row as a Horizontal stack view, and all rows together as a Vertical stack view.
- Set the vertical stack view Distribution as Fill Equally.
- Set constraints for each Horizontal stack view as theTopView.bottom = theBottomView.top, and vice versa.
- Set constraints of each element inside each Horizontal stack view as element.Top = stakcView.Top, element.Bottom = stakcView.Bottom.
Gap with distance set at 0:
However, there are always gaps between the Horizontal stack views, despite showing the distance between them being 0.
Can someone tell me what I did wrong? Why are there gaps despite showing 0 as the distance between these two? Your help is really appreciated!
constraints:
RED
resolve that issue and the rest will become clear relatively quickly. – xTwisteDx