I'm using the content mode Aspect Fill for my UIImageView, and its working the way I want it for the most part. What I'm noticing is that it looks like it uses the middle section of the image as the part that it crops to make it fill the bounds. How can I do aspect fill, but have it use the top portion of the image?
You can do this using the subclass UIImageViewAligned as long as the picture you are using is taller than it wide.
Here we have a base image where height > width
Using this image in the example project with regular aspect fill
And aspect fill top
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