Alexander Farber
Alexander Farber

Reputation: 23038

Setting text color in a StyleableTextField

Please advise me, how to set the text color in a StyleableTextField.

The following doesn't work for me (the color stays black):

  tf.setStyle('color', 0xFF0000);

And this too:

  tf.setStyle('color', 'red');

Upvotes: 0

Views: 463

Answers (1)

AlBirdie
AlBirdie

Reputation: 2071

StyleableTextField has a textColor property. Try using that. (tf.textColor = 0xFF0000;).

However, I found that in my ItemRenderers I sometimes need to use both the textColor property and the setStyle to properly change colors of StylableTextFields. Don't really know why, yet.

Upvotes: 1

Related Questions