How can I create an image button in Xamarin.Forms?

Please tell us how to create an image button in Xamarin.Forms, we are not using a story panel.

Environment: Xamarin Studio on Mac


source to share

2 answers

Many ways, like this one:

var button = new Image { ... }; // make your image your button should be
button.GestureRecognizers.Add (new TapGestureRecognizer (sender => {
  // Do whatever you want to do when its tapped
  button.Opacity = 0.6;
  button.FadeTo (1);


Or you can even use Xamarin forms labs:

Or like @Gerald Versluis say:

With an image of a button property.






Xamarin.Forms.TapGestureRecognizer.TapGestureRecognizer (System.Action)

deprecated: "Deprecated in 1.0.2. Use the command instead

Try this one:

  var CallButton = new Image { Source = "call.png" };
      CallButton.GestureRecognizers.Add(new TapGestureRecognizer
              Command=new Command(()=> {
                // Do whatever you want to do when its tapped


For more information, check the following link:



All Articles