Text formatting for a string
Can I set the font size for string? 开发者_JS百科 I want to do text formatting for string, Is it possible in flex?
You can use TextField/UITextField to display formatted text. In both classes you have two options:
- You can use setTextFormat() method to format text
- You can use htmlText property to display HTML text. These classes don't support all HTML tags. Supported HTML tags are listed here.
If all you need to do is change the font, you can use the StyleableTextField class or the Label and set the . She can set the fontSize style of either class to globally change the font size.
No,
you need to set the font size of label or any text other Text control that you use to show string value.
var str:String = 'This is sample text';
//set in any method
lbl.text = str;
lbl.setStyle('fontSize', 20);
enjoy.
精彩评论