AspectFit Not Working for Transformed UIImageView
- by Dex
I have a UIImageView inside a subview and I'm trying to get an AspectFit content mode working how I want for a 90 degree transformation.
Here is a demo app of what I mean https://github.com/rdetert/image-scale-test
If you run the app and hold it in a landscape orientation (app runs in landscape) you'll see that the image does not stretch from left edge to right edge.
What seems to be happening is that the AspectFit works correctly for the portrait/default orientation, but then the image simply gets rotated the image after the fact.
How can I make it auto stretch? I think the fact that it is inside a subview may have something to do with it?