Question

J'utilise actuellement quelque chose comme : TextView.SetBackgroundColor(Color.WHITE); dans mon code java.J'aimerais pouvoir ajouter un peu de transparence à la vue texte via Java...C'est facile à faire dans le XML via #AARRGGBB format, mais je n'ai pas trouvé de moyen d'accomplir cela par programme.

Était-ce utile?

La solution

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

Ou:

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

Autres conseils

Vous pouvez utiliser

TextView.SetBackgroundColor(Color.parseColor("#AARRGGBB"));
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top