I have a modalView that I am presenting with the UIModalPresentationPageSheet style, and this view has a scrollView, and an mageView inside of that scrollView to make it so I can show images, and allow for user manipulation such as zooming, etc.
In viewDidLoad this is how I am setting everything up:
CGRect imgFrame = CGRectMake(0, 0, img.size.width, img.size.height);
imageView.frame = imgFrame;
[imageView setImage:img];
Which works fine, but the problem I’m having is that if I have an image that is bigger than the somewhat small modalView size when in landscape mode (due to the UIModalPresentationPageSheet style), it doesn’t zoom out and scale so I can see the whole thing, it just shows me 2/3 of the image, and in order to see there is more I have to actually zoom out.
I have set the contentMode to UIViewContentModeScaleAspectFit, and it still didn’t change anything.
Am I missing something?
Set the image view’s frame to have a max width and height of the screen’s dimensions depending on the current orientation.
Something like:
That would apply to portrait mode on an iPhone (different for iPad). You’ll have to reset that frame when there is an orientation change.