iOS UIScrollView with UIImageView rotation aspect problem
I apologize in advance for my lack of iOS SDK knowledge, I am an Android developer that has been tasked with maintaining and updating an iPhone application.

I am using a UIScrollView to handle zooming and dragging of an image that is being displayed on a UIImageView.

The image in the UIImageView is requested from a web server multiple times a second.  When the orientation of the device changes the image dimensions change to that of the current frame, for example when using an iPad in portrait mode the image dimensions will be 768x1024 but when switching to landscape mode the dimensions of the image will be 1024x768.  The webserver does the work of adding black bars to the top/bottom or left/right of the image depending on the orientation and aspect ratio of the image I am requesting.

My problem is that after rotating the device the UIImageView never behaves the way I expect it to.  My expected behavior is that the UIScrollView will continue to perform its scrolling actions but reset its base view to that of the new frame dimensions after rotation.

If I don't specify a contentMode for the UIScrollView then the Image appears squished as though the ScrollView is trying to display the image in the previous orientations dimensions.

If I specify a contentMode of UIViewContentModeScaleAspectFit for the ScrollView and zoom all the way out the image appears smaller than the View, the aspect ratio is correct, but the image is centered and the height is that of the previous orientations.

If I specify a contentMode of UIViewContentModeScaleAspectFill for the ScrollView everything appears correctly, but since the View is actually scaling the image up to fit the screen when I exit the scrollView the zoom data that I was using doesn't properly translate over.

What do I need to do to set the "base size" of the UIScrollView to the new frame size when the device orientation has changed?  Or am I missing a property that I need to have set?
iOS UIScrollView with UIImageView rotation aspect problem
===

I apologize in advance for my lack of iOS SDK knowledge, I am an Android developer that has been tasked with maintaining and updating an iPhone application.

I am using a UIScrollView to handle zooming and dragging of an image that is being displayed on a UIImageView.

The image in the UIImageView is requested from a web server multiple times a second.  When the orientation of the device changes the image dimensions change to that of the current frame, for example when using an iPad in portrait mode the image dimensions will be 768x1024 but when switching to landscape mode the dimensions of the image will be 1024x768.  The webserver does the work of adding black bars to the top/bottom or left/right of the image depending on the orientation and aspect ratio of the image I am requesting.

My problem is that after rotating the device the UIImageView never behaves the way I expect it to.  My expected behavior is that the UIScrollView will continue to perform its scrolling actions but reset its base view to that of the new frame dimensions after rotation.

If I don't specify a contentMode for the UIScrollView then the Image appears squished as though the ScrollView is trying to display the image in the previous orientations dimensions.

If I specify a contentMode of UIViewContentModeScaleAspectFit for the ScrollView and zoom all the way out the image appears smaller than the View, the aspect ratio is correct, but the image is centered and the height is that of the previous orientations.

If I specify a contentMode of UIViewContentModeScaleAspectFill for the ScrollView everything appears correctly, but since the View is actually scaling the image up to fit the screen when I exit the scrollView the zoom data that I was using doesn't properly translate over.

What do I need to do to set the "base size" of the UIScrollView to the new frame size when the device orientation has changed?  Or am I missing a property that I need to have set?