Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Change only border/text color on button "Pressed" event

$
0
0

I need your help. I searched for a long time the answer to this problem but I can not find it.

I need to create a button that during the "Pressed" event only changes the color of the text and the border, but xamarin insists on putting a gray background even though I forced the same color during the event.

For example, I have a button with the following setting:

<Button x:Name="bt1"
        Text="Clique Aqui!!"
        TextColor="Black"
        BackgroundColor="White"
        BorderColor="Black"
        BorderWidth="1"
        Pressed="bt1_Pressed"
        Released="bt1_Released"
        Clicked="bt1_Clicked"
/>

During the "Pressed" event, I want it to only change the color of the text and the border, so I have the following code in the event:

private void bt1_Pressed(object sender, EventArgs e)
{
    bt1.BackgroundColor = Color.White;
    bt1.TextColor = Color.Orange;
    bt1.BorderColor = Color.Orange;
}

But he insists on putting a gray background while being held.

If I force a strong color like blue or red for example, it changes the background normally, but when I try to force the same color it does not accept.

How do I solve this problem?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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