Frage

I'm trying to make a text view change its text colour depending on what the value is in an XML file.

I've managed to get an XML parser which I vaguely know what it is doing, and I'm writing the elements value to the log.

Is this even possible or will I have to store the results from the XML parse first before I can use them to change the text views text colour?

War es hilfreich?

Lösung

It's fully possible :)

yourTextView.setTextColor(Color.parseColor("#FFFFFF"));

where "#FFFFFF" of course is the color value string from your XML.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top