Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug on hidesBarsOnTap #56

Closed
Bronko44 opened this issue Dec 19, 2017 · 7 comments
Closed

Bug on hidesBarsOnTap #56

Bronko44 opened this issue Dec 19, 2017 · 7 comments

Comments

@Bronko44
Copy link

Hello Harshil Shah! Thanks a lot of what are you doing!!
In ios11 I found interesting bug. On hiding navigation bar on tap it disappears like on foto. Can you help with this?

screen shot 2017-12-19 at 7 53 49 pm

screen shot 2017-12-19 at 7 54 03 pm

@Bronko44
Copy link
Author

It works good on version 0.4, but now don't

@HarshilShah
Copy link
Owner

Sorry for the delay in the response.

I think I might have a solution here, but since I don't have access to your code I'm gonna need some help.

Could you let me know if adding scrollViewUpdater = nil right after this line here https://github.com/HarshilShah/DeckTransition/blob/master/Source/DeckPresentationController.swift#L583 solves the issue for you?

@Bronko44
Copy link
Author

Bronko44 commented Feb 2, 2018

I use standard QuickLook library(QLPreviewController) to open files. And this QLPreviewController have default set "hide bars on tap". When I tap on image navigation bar disappears(he moves up through the black area, It seems that the position of the navigation bar is incorrect when hiding) and this func
@objc private func handlePan(gestureRecognizer: UIPanGestureRecognizer) is not called at all.
Unfortunately this line of code did not help.

@HarshilShah
Copy link
Owner

Hmm, interesting. Could you possibly upload a minimal demo project by modifying the example app to reproduce your issue?

@Bronko44
Copy link
Author

Bronko44 commented Feb 5, 2018

Yeah sure, here is example:
https://github.com/Bronko44/example

@HarshilShah
Copy link
Owner

HarshilShah commented Feb 5, 2018

Thank you so much for the example project!

So the issue here is that since navigation controllers are usually presented fullscreen, they just translate the bars directly with no clipping. Fortunately there's a simple solution for this.

In the DetailsVC, if you use the following line, it will clip the navigation bar's contents:

navigationController?.view.clipsToBounds = true

Clipping has a performance cost sometimes, depending on exactly what drawing is going on, so I'd suggest toggling it with caution, but it does indeed make the animation look as you want it to.

@Bronko44
Copy link
Author

Bronko44 commented Feb 5, 2018

Thanks a lot, this solved the problem. And thanks for a detailed explanation to, I appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants