How to add an icon to the button in xamarin?

1

Well, I've come across a silly thing here that has left me stuck, I'd like to put an icon on a button inside the layout of my application, so I'm not able to do it under my button code ... could someone tell me how to do this ??

 <Button Text="Criar Chamado"
                    TextColor="White"
                    BackgroundColor="#800000"
                    Clicked="btnLogin_Clicked"
                   />
    
asked by anonymous 08.02.2018 / 17:28

1 answer

1

You can use the Image property of buttons and provide an available feature 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 should be a nome_arquivo_imagem.png file in the \Resources\drawable     

08.02.2018 / 18:04