How do i programatically set the background color of a view using xamarin from the hex value
For example
view.BackgroundColor = Color.FromHex("#00162E");
I believe you're looking for the ParseColor method that takes in a string and returns the integer color.
view.BackgroundColor = Android.Graphics.Color.ParseColor("#FF6A00");
Supported formats are:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With