Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly add an UIImageView inside an UIStackView

My UIImageView is loaded with a picture with a high resolution. When I add the UIImageView to the UIStackView, the stack view will grow up to 1900x1200 dimension. The UIImageView contentMode is set to Aspect Fill.

What can I do so that the image remains with its current dimension (130x130) after adding it to the stack view ?

like image 302
Adrian Avatar asked Aug 15 '15 17:08

Adrian


1 Answers

I hope you got your question answered by now, but if not here you go:

Simply add a height and width constraint to your UIImageView before putting it in your stack view. Make them both 130 and you should be good to go.

like image 174
Rob Norback Avatar answered Sep 21 '22 11:09

Rob Norback