This is what the view looks like after setting a horizontal stackview between the label and the activity indicator:
This is not the expected output because I want the label and the activity indicator to be close to each other. It looks like the stackview tried to assign similar widths to both subviews.
I tried assigning a 10 width constraint to the activity indicator and it ended up like this:
Here's the left panel:
How do I have a label with an activity indicator to the right of it?
I'm expecting something that looks like this:
This happens, because Stack View inserts constraints with required (1000) priority.
What you can do is change Content Compression Resistance Priority
of your label and Content Hugging Priority
of activity indicator to 1000
(no need in additional width constraint in that case)