marrioa
marrioa

Reputation: 1275

swift / StackView alignment of image next to a label with size control

I want to make the profile image beside the username using UIStackview but when I do it the image expand to the whole stack view.

What I did I Stacked the 3 labels one by one then together

So the question? how to control image size and make it stick there without expanding.

I want it to be like the image below

this is my project

I want it to be like this

Upvotes: 0

Views: 4142

Answers (1)

BangOperator
BangOperator

Reputation: 4447

Pin your image view height and width.

Edit : Stack work on single axis. Either vertical or horizontal. But not both. If you want to put your Image view in stack you can use nested stack views. Use a horizontal stack view with an Image view and a vertical stack view.

Find sample storyboard here!

[enter image description here][enter image description here]3enter image description here

Upvotes: 2

Related Questions