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

Touch Events in Xamarin.Forms?

$
0
0

I'm using a TabGestureRecognizer to make an image behave like a button. (See below) I have two versions of this image (back_button_up.png and back_button_down.png). I want to swap the images on "Touch Start" and "Touch End". How can I accomplish this in XF directly? If I was working in one of our mobile websites, I would simply use the "ontouchstart" and "ontouchend" events. What's the XF equivalent?

var img = new Image() { Source =ImageSource.FromResource("MyNameSpace.Images.back_button_up.png"); };
var tgr = new TapGestureRecognizer();
tgr.Tapped += tgr_Tapped;
img.GestureRecognizers.Add(tgr);


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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