Question

I'm currently using something like: TextView.SetBackgroundColor(Color.WHITE); in my java code. I'd like to be able to add some transparancy to the textview through the java... This is easy to do in the XML via #AARRGGBB format, but I have not found a way to accomplish this programmatically.

Was it helpful?

Solution

TextView.SetBackgroundColor(Color.argb(a_int, r_int, g_int, b_int));

Or:

TextView.SetBackgroundColor(Color.parseColor("#AARRGGBB"));

OTHER TIPS

You can use

TextView.SetBackgroundColor(Color.parseColor("#AARRGGBB"));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top