views:

479

answers:

2

I am working on a photo gallery iPhone app.

Approach is fairly inspired from the ScrollingMadness code available on github. I have a scroll view which holds all my image views when in paging mode. When user zooms an image using pinch out gesture, I remove all the image views but the current one - and set the content offset to 0,0 (obviously).

Everything works perfect on simulator but on device I face this crazy issue. When a user pinch out to zoom an image, it goes off screen and when the pinch out touch event ends, it comes back to the screen.

After zooming the image once, if I zoom it further - it does not give me the buggy experience. This leads me to a conclusion that patch needs to be applied where I am removing the other image views from the scroll view and holding the one which is being zoomed.

Not able to figure out how I should make it to work like the iPhone's Photo app. The - magical - Photos app!

Anyone who can point to a direction to get this thing up and running - would be all the help I need right now!

A: 

Well, since when you zoom you are moving your picture to (0,0) effectivly the first page, you would expect when the user pinches any page thats not the first one, the image will have to move to 0,0 and therefore you are expiriencing your image moving. After you zoomed once, the image is already at 0,0 so subsequent zooms work fine. Are you finding that zooming on the very first page gives you the behavior you want and only other pages have this issue? If so a fix might be not to move the zooming picture to (0,0) but just keep it where it is and have some dummy view for all your other pages so you dont take up memory from the other pictures. Hope this helps

Daniel
A: 

Hi, I think this may help u
http://www.naveenshan.yolasite.com/blog/view-slider

NaveenShan