Please let us know how to create Image Button in Xamarin.Forms, we aren't using the story board.
Environment : Xamarin Studio on Mac
Please let us know how to create Image Button in Xamarin.Forms, we aren't using the story board.
Environment : Xamarin Studio on Mac
A lot of 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:
https://github.com/XLabs/Xamarin-Forms-Labs
Or like @Gerald Versluis say:
With image property of the button.
Image="logo.jpg"
Actually
Xamarin.Forms.TapGestureRecognizer.TapGestureRecognizer(System.Action)
is obsolete: 'Obsolete in 1.0.2. Use Command instead
Try like 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 info, Check the following link:
http://www.c-sharpcorner.com/UploadFile/e04e9a/xamarin-forms-image-button-recipe/