【问题标题】:RichText doesn't work with bulletsRichText 不适用于项目符号
【发布时间】:2011-07-25 09:24:39
【问题描述】:

请参阅下面创建的简单应用程序。我有一个 RichTextEditor 和一个 RichText 组件。这个想法是在 RichText 组件中显示在 RichTextEditor 中键入的任何内容。除了子弹之外,其他一切(我认为)都有效!转换就像子弹不存在一样工作!

<?xml version="1.0" encoding="utf-8"?>
<s:Application width="100%"
               height="100%"
               xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark"             
               xmlns:mx="library://ns.adobe.com/flex/mx">

    <s:layout>
        <s:HorizontalLayout />
    </s:layout>

    <fx:Script>
        <![CDATA[
            import flashx.textLayout.conversion.TextConverter;          
            import mx.events.FlexEvent;

            protected function convert_clickHandler(event:MouseEvent):void
            {
                richText.textFlow = TextConverter.importToFlow(editor.htmlText, TextConverter.TEXT_FIELD_HTML_FORMAT);
            }
        ]]>
    </fx:Script>


    <mx:RichTextEditor id="editor" />

    <s:Button id="convert" click="convert_clickHandler(event)" />

    <s:RichText id="richText" />

</s:Application>

关于如何使 Bullets 与 RichText 一起使用的任何想法?我使用正确的转换方法吗? TextConverter.importToFlow?

见下图。

【问题讨论】:

    标签: apache-flex flex4 rich-text-editor richtext


    【解决方案1】:

    TEXT_FIELD_HTML_FORMAT 不支持列表项。您需要创建自己的支持添加的 TextFlow 功能的编辑器。 Tour de' Flex 中有一个这样的编辑器的示例,但它是在 TLF 2 中的列表支持之前编写的。我不确定它是否已更新,但如果没有,您需要自己添加该功能。

    祝你好运!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-23
      • 1970-01-01
      • 1970-01-01
      • 2019-03-16
      • 2013-11-07
      • 1970-01-01
      • 1970-01-01
      • 2011-05-12
      相关资源
      最近更新 更多