简体   繁体   English

如何在flex中设置文本突出显示颜色?

[英]how to set text highlight color in flex?

I want to set the background color or highlight color of selected text in text area in Flex as we can set highlight color of text in MS Word. 我想在Flex的文本区域中设置选定文本的背景颜色或突出显示颜色,因为我们可以在MS Word中设置文本的突出显示颜色。

And after setting this highlight color user can also edit this text without disappearing this highlight color. 设置此突出显示颜色后,用户还可以编辑该文本,而不会消失该突出显示颜色。

Please help me doing this. 请帮我这样做。

Any help or any idea will be appreciated. 任何帮助或任何想法将不胜感激。

Thanks. 谢谢。

U can use the TextRange class to hightlight text it highlights U可以使用TextRange类突出显示突出显示的文本

Text Highlighter 文字萤光笔

Then add the keypress eventListener for the textArea and check with proper condition 然后为textArea添加keyevent eventListener并检查条件是否正确

and set the text Highlighter during edit. 并在编辑过程中设置文本荧光笔。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM