how to set the images in aspect fill when using the auto layout. When i design in storyboard it's perfectly fine but when setting the image, the height of image view goes very high. i want it to be a constant , i've also added the constant for that but it doesn't work. i'm using the latest Xcode.
From Apple Document, AspectFill
is not guaranteed to clip the content.
The option to scale the content to fill the size of the view. Some portion of the content may be clipped to fill the view’s bounds.
So you need to set clipToBounds
property to True, or set it in Storyboard.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With