mwaterfall / MWPhotoBrowser

A simple iOS photo and video browser with grid view, captions and selections.
MIT License
8.75k stars 2.72k forks source link

experience jerk when the navigation bar hide. #206

Open PrashantSharma15 opened 10 years ago

PrashantSharma15 commented 10 years ago

I use the photo browser to show a series of photo in my app. Its under construction.

I initialise MWPhotoBrowser and push it on the navigation controller.

when the photo loads everything okay. But when i tap the photo to hide navigation bar, the photo experiences a jerk as if the photo is zoomed in and zoomed out automatically.

Can you please help me out to resolve this.

mwaterfall commented 10 years ago

I've not experienced this issue before. Can you recreate it on the demo project?

PrashantSharma15 commented 10 years ago

i will create a demo project some hours from now, and give you the link.

mwaterfall commented 10 years ago

Okay. Please try and re-create the bug using the demo project that comes with MWPhotoBrowser.

KamranKhan-DL commented 10 years ago

Another jerk occurs when toolbar his being hidden (slide and alpha value set to 0). I disabled the alpha value and found out that the toolbar was only being moved 20 px down, which should have been more than that (44 px i think). I made the following change to code
_toolbar.frame = CGRectOffset(_toolbar.frame, 0, animatonOffset * 2);

Also please take out caption finding loop out of the animation block so that animation block has only code relevant to animation.

The jerks are possibly due to auto-layout of the view. Frame size of the view (main view) change when navigation bar gets hidden (by setting alpha to 0), which in turn resize all the subviews.

mwaterfall commented 10 years ago

Is it possible to get this bug to show itself within the demo app?

mwaterfall commented 10 years ago

Also, @kamran07, I don't see any issue in keeping the loops inside the animation block. That code is only ever run once and the time taken within the loops is negligible.

KamranKhan-DL commented 10 years ago

thanks. I have made changes to the code, but you can try by commenting the _toolbar.alpha value change in the animation and increasing the animation time to see the effect. I have made changes to the code, but I will try to send a demo app.

KamranKhan-DL commented 10 years ago

I couldn't replicate the issue with the new project, may be it was because i hid the navigation bar to use a custom one. Anyways, thanks for the wonderful work. I have stripped down the code for my needs and have added the ability to also load custom views along with pictures. I am attaching the code, its not perfect in this form but if anyone needs an idea to load videos along with the pictures, they can do using this view or a similar functionality. Here is the dropbox link https://www.dropbox.com/s/p4utttz453aliyi/PhotoViewerTest.zip

samsidd commented 6 years ago

i am facing the same issue, i can't find a work around this.