Restrict images in scroll view to stretch when iPhone moved to landscape orientation
-
05-07-2019 - |
Question
I have imageViews as content for in the UIScrollView. If a user is viewing a potrait picture (320x480) and moves the iPhone in landscape orientation - the image stretches to occupy full screen. I want to restrict the image to stretch. I want a functionality similar to the photos app where image is scaled down and shows black strips in left and right.
Anyone with any suggestion how I can achieve this - would be a great help!
Solution
When you rotate, instead of letting your UIIMageView expand, resize its frame to be what you want it to be...that should take care of it.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow