UIPhotoGallery icon indicating copy to clipboard operation
UIPhotoGallery copied to clipboard

Photo scrollview animates on rotation

Open ramonpoca opened this issue 11 years ago • 2 comments

Hi there,

I'm using UIPhotoGallery on an App, but I've found out a quirk that I don't know how to fix. When changing rotation on the device I hide the top bar on landscape and "maximize" the photo view. The problem seems to be that during the rotation, the scrollview position is animated, so I see the previous or next photos scrolling out until I go back to the current one.

Anyone has any idea on how to avoid that?

ramonpoca avatar Aug 12 '13 12:08 ramonpoca

Hi,

When device changes orientation, application calls gallery view's layoutSubviews method, which invokes setupMainScrollView method from UIPhotoGalleryView.m. At line 271, the gallery view scroll to page index before orientation changed (without animation). But I don't know why it still animate. May be I'll find a way resolve this problem soon.

Thanks :)

ethan605 avatar Aug 12 '13 12:08 ethan605

I solved it by getting current ImageView, adding it as a subview of the controller's view, hiding vPhotoGallery when the transition starts and doing the opposite when it ends. This results in nice animation without scrollview going crazy, but it is ugly solution that I don't feel like sharing. I am sure people can come up with your own along similar lines, but it would be nice if the UIPhotoGallery supported it out of the box

Lopdo avatar Dec 01 '14 08:12 Lopdo