I am trying to add a highlight gesture to an image in a ListView
The ListView displays an Image without the Image.GestureRecognizers section, but with it the ListView does not display anything (no error message). To clarify this, the ListView also has a shortcut that also does not appear.
<Image x:Name="newsImage" VerticalOptions="End" HeightRequest="200" WidthRequest="200" Aspect="AspectFill" Source="{Binding Imageurllarge}"> <Image.GestureRecognizers> <TapGestureRecognizer Tapped="OnTapGestureRecognizerTapped" NumberOfTapsRequired="1" /> </Image.GestureRecognizers> </Image>
I took this from http://developer.xamarin.com/guides/cross-platform/xamarin-forms/working-with/gestures/ (suppose this example is intended not to be list view, but suggested that it should work within the list).
Also (as suggested by comments)
<Image.GestureRecognizers> <TapGestureRecognizer Command="{Binding TapCommand}" CommandParameter="newsImage" />
It doesn't seem to look any better.
If anyone has an example of how to add this to the code behind (without being able to view), then this will do.
xamarin xamarin.forms
Wickedw
source share