0

似乎 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>
4

1 回答 1

1

我遇到了这个问题,解决方案是在外部应用样式。

意味着当视图发生变化时,将 css 应用于 rte。

祝你今天过得愉快....

于 2012-05-25T13:30:18.207 回答