<controls:CarouselViewControl.GestureRecognizers> is not Working!

MohanasundharamMohanasundharam Member ✭✭✭
edited October 21 in Xamarin.Forms

Here, <controls:CarouselViewControl.GestureRecognizers> is not working when it tap,

                                <controls:CarouselViewControl.GestureRecognizers>
                                    <TapGestureRecognizer NumberOfTapsRequired="1" Tapped="ItemTappedEvent">
                                    </TapGestureRecognizer>
                                </controls:CarouselViewControl.GestureRecognizers>          

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    It seems this is a known issue on Android:
    https://github.com/alexrainman/CarouselView/issues/200
    You need to customize your own item template and define the gestures there:

    <DataTemplate>
        <Grid>
            <Grid.GestureRecognizers>
                <TapGestureRecognizer Command="{Binding Path=BindingContext.ViewItemsDetailsCommand, Source={x:Reference Name=myCarouselViewCtrl}}"
                                                  CommandParameter="{Binding}"/>
            </Grid.GestureRecognizers>
            <ffimageloading:CachedImage
                            Aspect="AspectFill"
                            DownsampleToViewSize="False"
                            FadeAnimationEnabled="True"
                            FadeAnimationForCachedImages="True"
                            Source="{Binding ImageUri}"
                            ErrorPlaceholder="error.png">
            </ffimageloading:CachedImage>
        </Grid>
    </DataTemplate>
    
Sign In or Register to comment.