Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to add tap and long press gesture to image in xamarin.forms?

$
0
0

I need to add long press and tap gesture recognization in xamarin forms. Successfully added long press effect in xamarin forms but long press gesture is working and tap gesture is not working. how to work both at the same time.
<Image x:Name="img" HeightRequest="100" HorizontalOptions="End" Source="info.png" VerticalOptions="CenterAndExpand" WidthRequest="100"><Image.Effects> <effects:LongPressedEffect /> </Image.Effects> </Image>

`public MainPage()
{
InitializeComponent();
var gesture = new TapGestureRecognizer();
gesture.Tapped += Gesture_Tapped;
img.GestureRecognizers.Add(gesture);
}

    private void Gesture_Tapped(object sender, System.EventArgs e)
    {
  //not working
    }`

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>