victorh1705 / starbucks_ios_uikit

0 stars 0 forks source link

Auto Layout constraits error on HomeViewController #1

Open victorh1705 opened 1 year ago

victorh1705 commented 1 year ago

I would like to make the header fulfill all the width in HomeViewController and also create some custom insets to different UIVIew.
How can I do that inside a UIStackView without interfering other views?

<img src="https://user-images.githubusercontent.com/6753782/228049682-f885c735-0e6d-44ed-8f95-68377a3a50d5.png" width="300px" />

nathan-batista commented 1 year ago

You can't set a inset to each view inside your stack view, once you define a inset to your stack View, it will affect all your views, what you can do is make your header view constrain to the stack view width and the other views you can wrap them in a container and add constraints or use 2 different stack views