Spark TextArea - 更改文本颜色的一部分

时间:2012-11-05 15:00:18

标签: flex colors styles textarea flex-spark

如何更改spark.components.TextArea中的部分文字颜色?

2 个答案:

答案 0 :(得分:2)

TextArea可以做到这一点。试试这个:

    var format:TextLayoutFormat = new TextLayoutFormat();
    format.color = 0x00ff00;            
    this.textarea.setFormatOfRange(format, startIndex, endIndex);

答案 1 :(得分:1)

好吧,TextArea无法做到这一点。您应该尝试使用RichText或一些相关组件。

http://help.adobe.com/en_US/flex/using/WS02f7d8d4857b1677-165a04e1126951a2d98-7fca.html