-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
Adding gesture recognizer to backdropView does not work #99
Comments
Hello, @fmessina! Thanks for your usage! I'm sorry I can't reproduce this issue. On Samples app, a tap gesture recognizer added into But If a |
Hi!
Thanks for the quick answer.
Probably then it is because the backdropView's alpha is zero.
What I’m trying to achieve is a simple “tap outside to dismiss”, no matter if the alpha is zero or not.
I think it is an useful functionality for the library too.
What do you suggest to achieve it?
…Sent from my iPhone
On 8 Jan 2019, at 01:34, Shin Yamamoto ***@***.***> wrote:
Hello, @fmessina! Thanks for your usage!
I'm sorry I can't reproduce this issue. On Samples app, a tap gesture recognizer added into backdropView is working well. https://github.com/SCENEE/FloatingPanel/blob/master/Examples/Samples/Sources/ViewController.swift#L150
But If a , a tap gesture recognizer of it doesn't work by design.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I ended up with this solution: In my func backdropAlphaFor(position: FloatingPanelPosition) -> CGFloat {
return position == .half ? 0.05 : 0.0
} This way I have an almost invisible alpha on the Looks a bit like an hack but it works :) |
Let me confirm your background. Do you present a floating panel view controller modally? |
I'm sorry I found an unexpected behavior if a floating panel controller is presented modally. The controller should not block any touch events if the backdrop view's alpha is zero because it seems to able to touch views behind the backdrop view. I made a My original expectation is different from yours. What do you think of the expectation? |
I think your expectation is correct too. What I wanted is to tap outside to dismiss it, so maybe if the alpha is zero the tap gesture should go on the presenting view controller. Thanks for the fix, I will pull it when it will be released. |
Thank you for your confirmation! I merged the branch to the master. I will release v1.3.2 soon. |
Hi and thanks for the library :)
I've been trying to add a gesture recognizer to the
backdropView
to dismiss the panel, but I can't get it to work. It's like if the selector attached to the gesture never gets called.I'm on the last version.
This is how I do it (as described here https://github.com/SCENEE/FloatingPanel#add-tap-gestures-to-the-surface-or-backdrop-views)
and
If I add the tapGesture on the
surfaceView
everything works.Any idea?
Thanks!
The text was updated successfully, but these errors were encountered: