这是我的 MXML
<mx:Text id="name" styleName="textStyle" maxWidth="400"></mx:Text>
然后在同一个文件中我有:
<mx:Script>
<![CDATA[
private function init():void
{
name.text = data.string;
}
]]>
</mx:Script>
data.string
来自数据库,它包含以下内容:
"This is a string \n with two lines."
我也尝试过这个:
"This is a string with two lines."
它们都没有在 Flex 中创建新行,它们都被渲染到屏幕上\n
and
.
如何使用来自数据库的字符串创建新行?
如果我输入\n
就像它的代码一样:
name.text = "test \n test";
但如果我这样做name.text=data.string;
但它没有data.string
具有完全相同的值。
我想你可以在这个网站上找到你想要的东西。
http://www.switchonthecode.com/tutorials/flex-php-tutorial-transmitting-data-using-json http://www.switchonthecode.com/tutorials/flex-php-tutorial-transmitting-data-using-json
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)