我想让背景看起来好像打开了一个模态窗口但是,我想使用Spark TextArea而不是窗口。这可能吗?
答案 0 :(得分:1)
您可以使用PopUpManager创建任何IFlexDisplayObject作为模态视图。
示例:
<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">
<fx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import spark.components.TextArea;
protected function button1_clickHandler(event:MouseEvent):void
{
var ta:TextArea = new TextArea();
ta.width = 300;
ta.height = 200;
PopUpManager.addPopUp(ta, this, true);
PopUpManager.centerPopUp(ta);
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Button label="Click" click="button1_clickHandler(event)"/>
</s:Application>