How to capture hoizontal swipe in a WebView

Moshe Raab, PhD 236 Reputation points
2020-10-21T14:15:05.08+00:00

I created a Xamarin App that utilizes a WebView2 control. the control displays a lot of HTML code.
I am able to scroll vertically, but I would like to add the functionality of PgUp and PgDn based on a swipe left or right
I thought i would be able to catch a Swipe event like this:

       SwipeGestureRecognizer swipe = new SwipeGestureRecognizer { Direction = SwipeDirection.Left | SwipeDirection.Right };
        swipe.Swiped += OnSwiped;
        webView.GestureRecognizers.Add(swipe);

OnSwipe is never called. (Tested in both UWP and Android)
(I am also not getting any errors when this code runs

Am i leaving anything out?
Thanks

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,647 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Richard Zhang-MSFT 6,936 Reputation points
    2020-10-22T02:26:43.507+00:00

    Hello,

    Welcome to Microsoft Q&A.

    Currently Q&A does not support the topic of Xamarin. You can ask the question on Xamarin Community Forums, where relevant engineers are actively solving the problem.

    Thanks.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.