9.9.压缩空格
问题
我想显示HTML内容时压缩空格
解决办法
设置condenseWhite 属性为true
讨论
当在文本框里显示HTML内容时,可通过condenseWhite属性压缩空格,大多数浏览器都这么做。
例如,下面的文本在浏览器里渲染时只包含一个空格,而原始是多个空格,这是被压缩的结果。
hello friend
而在ActionScript的文本框显示HTML内容时也可进行压缩空格,只要把condenseWhite 属性设为true:
condenseWhite 属性只当htmlText 有内容时有效。
我想显示HTML内容时压缩空格
解决办法
设置condenseWhite 属性为true
讨论
当在文本框里显示HTML内容时,可通过condenseWhite属性压缩空格,大多数浏览器都这么做。
例如,下面的文本在浏览器里渲染时只包含一个空格,而原始是多个空格,这是被压缩的结果。
hello friend
而在ActionScript的文本框显示HTML内容时也可进行压缩空格,只要把condenseWhite 属性设为true:
+展开
-ActionScript
field.condenseWhite = true;
field.htmlText = "hello friend"; // 显示: "hello friend"
field.htmlText = "hello friend"; // 显示: "hello friend"
condenseWhite 属性只当htmlText 有内容时有效。
加支付宝好友偷能量挖...