Flex - RichTextEditor在视图更改后丢失样式

时间:2012-05-25 13:13:55

标签: actionscript-3 flex adobe

似乎flex的RichTextEditor中存在一个错误,即在更改视图(视图状态更改)时,RTE会丢失其格式。有没有人遇到过这个问题,知道如何解决它。任何帮助深表感谢。

<?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"
               minWidth="955" minHeight="600" xmlns:base="ui.components.base.*" xmlns:ui="ui.*" xmlns:local="*">

    <fx:Script>
        <![CDATA[
            import mx.events.FlexEvent;

            protected function click_clickHandler(event:MouseEvent):void
            {
                trace(this.rte.htmlText);
                this.currentState = "other";

            }

            protected function clickother_clickHandler(event:MouseEvent):void
            {
                this.currentState = "normal"
            }
        ]]>
    </fx:Script>
    <s:states>
        <s:State name="normal"/>
        <s:State name="other"/>
    </s:states>

    <s:VGroup includeIn="normal">
        <mx:RichTextEditor id="rte">

        </mx:RichTextEditor>
        <s:Button id="click" x = "500" y = "500" click="click_clickHandler(event)">

        </s:Button>
    </s:VGroup>

    <s:VGroup includeIn="other" >
        <s:Label>
            test
        </s:Label>
        <s:Button id="clickother" click="clickother_clickHandler(event)">
        </s:Button>
    </s:VGroup>
</s:Application>

1 个答案:

答案 0 :(得分:1)

我遇到过这个问题,解决方案是将风格应用于外部。

表示更改视图时将css应用于rte。

度过愉快的一天......