Events and gestures recognition

Max25Max25 FRMember ✭✭

Hi,

I am implementing a swipe detection. I successfully (but with limitations) did it with custom renderers but I was wondering if there is an easier way to achieve that.
At this moment I have a simple page containing a scrollview containing a stackLayout containing entries...
To implement the swipe I've done renderers (iOS and Android) for both the ScrollView and the StackLayout, then used events to send informations to my controls in PCL.

From here I see two problems:
1 - because events cannot get through the StackLayout to the ScrollView I have to make two renderers to get the swipe on my entire screen (I cannot use InputTransparent on my layout because it contains entries...)
2 - if I swipe over my entries, same problem thus the swipe is not detected

My first question is simple : Is this the good way to achieve that?
My second question : Why couldn't we set a null Background to says to my controls "hey you, let all events pass when your child did not consume them" ?

Thanks.

Max.

Posts

  • Max25Max25 FRMember ✭✭

    The problem '1' was solved with correct layout options.
    But the second problem cannot be fixed in Android (with iOS every level in my view receive events).
    The only way out I can see is to use a third library such as MrGestures. But I fear this kind of library will not be maintained as long as Xamarin Forms. What do you think about it?

    Thanks,

    Max.

Sign In or Register to comment.