I use Grid with SwipeGesture and ScrollView. ScrollView works well but SwipeGesture doesn't work only Android. In iOS I have not problem.
Why? Help me please
<Grid x:Name="grid">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<ScrollView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
...
</ScrollView>
</Grid>
C#:
var leftSwipeGesture = new SwipeGestureRecognizer { Direction = SwipeDirection.Right };
leftSwipeGesture.Threshold = 50;
leftSwipeGesture.Swiped += (sender, e) => Navigation.PopAsync();
grid.GestureRecognizers.Add(leftSwipeGesture);
I have had issues with setting a SwipeGestureRecognizer on a grid. I found wrapping the grid in an absolute layout worked just fine. Then set your GestureRecognizer to the absolute layout.
I resolved this problem based on link. I created a new component:
Android renderer:
CustomGestureListener:
Core: