Uiimageview inside uiscrollview position is not centered

I am developing an application for iPhone / iPad using Objective C. In my application, I have a UiScrollView that has a UIImageView in it. I can scroll and scale the image inside the scroll.

Everything works perfectly. But my problem is that when I load an image inside a uiscrollview, its position is in the center, but not quite.

I want either my image to be centered or in the upper left corner.

I set the contentoffset to (0,0) and also tried setting AutoresizingMask to different values.

Please let me know if anyone has any ideas or solutions.

+5
source share
1 answer

contentoffset - - scrollview , , . , , :

imageview.center = scrollview.center;

, , :

imageview.frame = CGRectMake(0,0,image_width,image_height);

!

+9

All Articles