How to add an icon to the button on Xamarin?

Asked

Viewed 645 times

1

Guys, I came across a silly thing here more that left me Arrado, I would like to put an icon on a button inside the layout of my application, so I’m not able to do, below the code of my button... could someone tell me how to do this??

 <Button Text="Criar Chamado"
                    TextColor="White"
                    BackgroundColor="#800000"
                    Clicked="btnLogin_Clicked"
                   />

1 answer

1


You can use the property Image and provide a resource available on your specific platform. So:

<Button Text="Criar Chamado"
        TextColor="White"
        BackgroundColor="#800000"
        Image="nome_arquivo_imagem.png"   
        Clicked="btnLogin_Clicked"/>

In the case of android, for example, there must be a file nome_arquivo_imagem.png in the directory \Resources\drawable

  • Thanks man, I didn’t know it was that simple!!

  • you are helping me so much, of the hour... because I’m starting now with Xamarin

  • 1

    How wonderful! You can count on the help of the community, whenever possible I will be participating!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.