在 TextArea.htmlText 中内嵌显示图像 [英] displaying an image inline in TextArea.htmlText

查看:49
本文介绍了在 TextArea.htmlText 中内嵌显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的聊天框中显示一些笑脸的中间文本,但是当我添加图像时,它会显示在单独的行上...

有什么想法吗?

<mx:TextArea id="myChat" width="271" height="238" backgroundColor="#ffffff" borderThickness="0" editable="false" enabled="true" horizo​​ntalScrollPolicy="关闭" wordWrap="true"><![CDATA[<字体大小='14'>一些文字 - </font><img src='images/emoticons/wink_smile.gif' height='15' width='15'/><font size='14'>更多文字]]></mx:htmlText></mx:TextArea>

解决方案

不幸的是,Flash 对文本字段中的 img 标签的支持是次要的;即使在 ,似乎描述了您遇到的确切问题.

无论如何,Valentin Manthei 似乎对此有一个解决方案.不过我自己没试过.

I would like to display some smiley's inbetween text in my chatbox but when i add an image it gets displayed on a seperate line...

Any ideas?

<mx:TextArea id="myChat" width="271" height="238" backgroundColor="#ffffff" borderThickness="0" editable="false" enabled="true" horizontalScrollPolicy="off" wordWrap="true">
    <mx:htmlText>
    <![CDATA[
         <font size='14'> some text - </font><img src='images/emoticons/wink_smile.gif' height='15' width='15'/><font size='14'> more text</font>
    ]]>                      
    </mx:htmlText>
</mx:TextArea>

解决方案

Unfortunately Flash's support for the img tag in text fields is subpar; even in the official Flex 3 documentation it says:

"Note: The <img> tag is not fully supported, and might not work in some cases."

There's an issue in the Adobe bug tracker that seems to describe the exact problem you're having.

In any case, Valentin Manthei seems to have a solution for this. I haven't tried it myself, though.

这篇关于在 TextArea.htmlText 中内嵌显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆