小编Rav*_*dia的帖子

在Spark TextArea中显示HTML文本

下面的代码运行良好......

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
      xmlns:s="library://ns.adobe.com/flex/spark" 
      xmlns:mx="library://ns.adobe.com/flex/mx" >
 <fx:Declarations>
  <mx:HTTPService id="httpRSS" url="http://www.petefreitag.com/rss/" resultFormat="object" />
 </fx:Declarations>
  <s:Panel id="reader" title="Blog Reader" width="500">
  <mx:DataGrid width="485" id="entries" dataProvider="{httpRSS.lastResult.rss.channel.item}" click="{body.htmlText=httpRSS.lastResult.rss.channel.item[entries.selectedIndex].description}">
   <mx:columns>
    <mx:DataGridColumn dataField="title" headerText="TITLE"/>
    <mx:DataGridColumn dataField="pubDate" headerText="Date"/>    
   </mx:columns>
  </mx:DataGrid>
  <mx:TextArea id="body" editable="false" width="485" x="3" y="142" height="155"/>
 </s:Panel>
 <s:Button label="Load" x="10" y="329" click="{httpRSS.send()}"/>
 </s:Application>
Run Code Online (Sandbox Code Playgroud)

但是当Textarea改为像下面那样激发Textrea时

<s:TextArea id="body" editable="false" width="485" x="3" y="142" height="155"/>
Run Code Online (Sandbox Code Playgroud)

然后htmlText不支持Spark Textarea.因此产生错误.如何使用spark Text Area Property显示HTML格式的文本.

apache-flex flexbuilder flex3 flex4

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

apache-flex ×1

flex3 ×1

flex4 ×1

flexbuilder ×1