color button C# Xamarin Android

Viewed 5036

I'm building a trivia application so i want when i press the button it will be Green if correct and will be Red if not. my main issue is that wehen i color the button he get larger and looses his grpahic shape.

private void Button2_Click(object sender, EventArgs e)
    {
        if (answer == "ב")
        {
            Button2.SetBackgroundColor(Android.Graphics.Color.Green);
        }
        else
        {
            Button2.SetBackgroundColor(Android.Graphics.Color.Red);
        }
    }

before button pressing after button pressing

thanks for helping!

1 Answers
Related