I am trying to create a stack view but I am having a hard time adding padding to the sides of the stacks like the photo. Is there a way to add add a stack view to a container (so I can add padding to inside of the container? In my version the [firstName, lastName etc] are all stuck to the side of the white container and when I add padding it is going to the stackView's total body (ie it is increasing the blue distance). I also want to make the sizes of the stacks different from one another (login button should be smaller than the text fields) and they're all coming out the same size. PS I am not using storyboards whatsoever.
Sure, u can just add your stack view as UIView subView. Just create new UIView, add it to you ViewController, and add your stackView same way to your UIView so u can constraint your stackView to your new UIView.
2.1m questions
2.1m answers
60 comments
56.9k users