iOS UIScrollView with UIImageView rotation aspect problem -


i apologize in advance lack of ios sdk knowledge, android developer has been tasked maintaining , updating iphone application.

i using uiscrollview handle zooming , dragging of image being displayed on uiimageview.

the image in uiimageview requested web server multiple times second. when orientation of device changes image dimensions change of current frame, example when using ipad in portrait mode image dimensions 768x1024 when switching landscape mode dimensions of image 1024x768. webserver work of adding black bars top/bottom or left/right of image depending on orientation , aspect ratio of image requesting.

my problem after rotating device uiimageview never behaves way expect to. expected behavior uiscrollview continue perform scrolling actions reset base view of new frame dimensions after rotation.

if don't specify contentmode uiscrollview image appears squished though scrollview trying display image in previous orientations dimensions.

if specify contentmode of uiviewcontentmodescaleaspectfit scrollview , zoom way out image appears smaller view, aspect ratio correct, image centered , height of previous orientations.

if specify contentmode of uiviewcontentmodescaleaspectfill scrollview appears correctly, since view scaling image fit screen when exit scrollview zoom data using doesn't translate over.

what need set "base size" of uiscrollview new frame size when device orientation has changed? or missing property need have set?

it sounds may not updating content size on scroll view. need like

scrollview.contentsize = newimagesize; 

hope that's it


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -