Apply ARGB color to a textview programmatically
I'm cur开发者_如何学JAVArently 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.
TextView.SetBackgroundColor(Color.argb(a_int, r_int, g_int, b_int));
Or:
TextView.SetBackgroundColor(Color.parseColor("#AARRGGBB"));
You can use
TextView.SetBackgroundColor(Color.parseColor("#AARRGGBB"));
精彩评论