If parent and child element have gestures , Then child element gesture only fired. Parent element gesture not fired for all platforms (UWP, Android and IOS)
<local:GridExt x:Name="ListView" BackgroundColor="AntiqueWhite">
<local:GridExt.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/>
</local:GridExt.GestureRecognizers>
<ScrollView>
<StackLayout>
<local:ContentViewExt x:Name="ListViewItemGrid">
<local:ContentViewExt.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped_1"/>
</local:ContentViewExt.GestureRecognizers>
<Label x:Name="Item" FontSize="Large" Text="ItemTemplate" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" HeightRequest="100" BackgroundColor="Gray"/>
</local:ContentViewExt>
</StackLayout>
</ScrollView>
</local:GridExt>
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void TapGestureRecognizer_Tapped(object sender, EventArgs e)
{
//DisplayAlert("ListView", "ListViewTappedFired", "Ok");
Debug.WriteLine("ListViewTappedFired");
}
private void TapGestureRecognizer_Tapped_1(object sender, EventArgs e)
{
//DisplayAlert("Item", "ItemTappedFired", "Ok");
Debug.WriteLine("ItemTappedFired");
}
}
public partial class GridExt : Grid
{
}
public partial class ContentViewExt : ContentView
{
}
I need child gesture fired and parent gesture fired. Give me any workaround.
Note : I am find the android workaround, Thats worked for me. But I need uwp and ios also
Android render file
public class GridExtRenderer : ViewRenderer<GridExt, Views.View>
{
public GridExtRenderer(Context context) : base(context)
{
}
public override bool OnInterceptTouchEvent(Views.MotionEvent ev)
{
OnTouchEvent(ev);
return base.OnInterceptTouchEvent(ev);
}
}
If child element have gesture then parent gesture not fired.
https://www.syncfusion.com/downloads/support/directtrac/general/ze/TouchTest876899649
@Yuvaraj-007 Thank you for the report. We're aware that our gestures conflict, and we're planning to improve gesture management in the future.
@PureWeen Did we ever put together that spec for gesture orchestration? We should get one published ASAP. Thanks!
Unluckily, Swipe Gestures are fired both for child and parent view. So this is heavily inconsistent and sounds like something very basic with gestures.
For example if I put a CollectionView in a StackLayout with a SwipeGestureRecognizer, the recognizer will fire along with the collectionview scroll, while normal should be that CollectionView "blocks" the Stacklayout's recognizer. Or at least there should be an option to do this.
Hi @balazserd,
My requirement is I need to write the touch gesture recognizer for both child and parent view..i am also doing the custom view create idea to do this.. So your idea not worked for me. I need a support from your basic controla not like custom view of swipe gesture.
Thanks and Regards,
Yuvaraj C
This wasn't a suggestion, this was just to clarify your bug is not consistent. SwipeGestures work the other way, and they're also bugged.