The aspect ratio of the image drawn in UIImageView on iOS17 is broken when the screen is rotated.

I am using AVCaptureSession to acquire images as needed and visualize them in UIImageView.

I rotate the device while capturing and the UI automatically fits with the auto-layout effect, but the visualized image no longer fits. iOS16 rotates the image correctly and the aspect ratio fits correctly.

Even if the image is corrupted, it is displayed with the correct aspect ratio when the ViewController is moved and returned.

As a workaround, it was possible to rebuild the UIImageView when rotating the screen, but I don't think this is a good solution.

I imagine that the UIImageView cache from iOS17 is causing the problem, but is there any good countermeasure?

Thanks!

The best I can recommend is you file a report at the https://feedbackassistant.apple.com/ and attach a sample project that demonstrates the issue. We have seen no such problems internally.

I'm facing the same problem in my app. My workaround was to set the image to nil while the screen is rotating and resume updating the images after the rotation completes.

The aspect ratio of the image drawn in UIImageView on iOS17 is broken when the screen is rotated.
 
 
Q