tapgesturerecognizer of stack layout in data tamplet not working xamarin forms iOS inside CarouselView
See original GitHub issueI’m trying to use tapgesturerecognizer in stack layout inside the data templet but its not working in iOS working fine in Android.
<cards:CarouselView x:Name="CarouselView" HeightRequest="209" Grid.Row="0"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand"
ItemAppearing="Handle_ItemAppearing"
ItemsSource="{Binding Photos}"
>
<cards:CarouselView.ItemTemplate>
<DataTemplate>
<ContentView>
<Grid BackgroundColor="{StaticResource lightBlueGrey}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0" BackgroundColor="{StaticResource lightBlueGrey}" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackLayout Grid.Column="0" Orientation="Vertical" VerticalOptions="Center" HorizontalOptions="Center">
<ffSvg:SvgCachedImage HeightRequest="53" WidthRequest="53" Source="swap_contact.svg" />
<Label Margin="14,0" Text="{Binding ContactString}" HorizontalTextAlignment="Center" FontFamily="{StaticResource NormalFont}" FontSize="13" FontAttributes="None" TextColor="{StaticResource BlueGrey}" />
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="ContactTapped" NumberOfTapsRequired="1" />
</StackLayout.GestureRecognizers>
</StackLayout>
<StackLayout Grid.Column="1" Opacity="{Binding Opacity}" Orientation="Vertical" VerticalOptions="Center" HorizontalOptions="Center">
<ffSvg:SvgCachedImage x:Name="FavIcon" HeightRequest="53" WidthRequest="53" Source="{Binding FavIcon}" />
<Label Margin="14,0" x:Name="FavLabel" Text="{Binding FavouriteString}" HorizontalTextAlignment="Center" FontFamily="{StaticResource NormalFont}" FontSize="13" FontAttributes="None" TextColor="{StaticResource BlueGrey}" />
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="FavoritesTapped" NumberOfTapsRequired="1" />
</StackLayout.GestureRecognizers>
</StackLayout>
<StackLayout Grid.Column="2" Opacity="{Binding Opacity}" Orientation="Vertical" VerticalOptions="Center" HorizontalOptions="Center">
<ffSvg:SvgCachedImage HeightRequest="53" WidthRequest="53" Source="swap_decline.svg" />
<Label Margin="21,0" Text="{i18n:Translate MatchesStringDelete}" HorizontalTextAlignment="Center" FontFamily="{StaticResource NormalFont}" FontSize="13" FontAttributes="None" TextColor="{StaticResource BlueGrey}" />
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="DeleteTapped" NumberOfTapsRequired="1" />
</StackLayout.GestureRecognizers>
</StackLayout>
</Grid>
<ffSvg:SvgCachedImage Grid.Row="0" HeightRequest="209" Aspect="AspectFill" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Source="{Binding Photo}" />
</Grid>
</ContentView>
</DataTemplate>
</cards:CarouselView.ItemTemplate>
</cards:CarouselView>
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
TapGestureRecognizer doesn't work when added to ...
On android it doesn't work. The only workaround i have found is adding de tapgesture inside the template for each item in the...
Read more >Xamarin Carousel GestureRecognizers Not Working
I want to implement a Carousel view swipe gesture recognizer left or right Swipes. But ONLY tapped event can be recognized ,gesture events ......
Read more >Trying to create a control template that inherits parent class ...
I am trying to make a template for a form on my Xamarin. ... Here is the problem, I have TapGestureRecognizers and several...
Read more >ImageButton Command not executed in Xamarin Form ...
hi, im trying to implement CaroulselView and add command to imagebutton in template. <CarouselView ItemsSource="{Binding weblinks}" ...
Read more >TapGestureRecognizer not working in CollectionView
Dear Community! I want to have a TapGestureRecognizer on my Posts on my Accountpage. Therefore i added the GEstureRecognizer.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Meanwhile, I got it solved. It was IsPanInteractionEnabled which should be True for iOS and False for Android. In my case was False, tested first on Android.
@AndreiMisiukevich will check and let you know.
Thanks a lot 😃