开发者

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:

  1. You can use setTextFormat() method to format text
  2. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜