Flex中真正隐藏控件
Flex中真正隐藏控件
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> <mx:Panel width="812" height="431" layout="absolute"> <mx:Button label="hide text" click="myText.visible=false; myText.includeInLayout=false;" x="31" y="10"/> <mx:Text id="myText" text="hello,this text will be hidden or shown, depending on the buttons" creationComplete="myText.visible=false" x="332" y="12"/> <mx:Button label="show text" click="myText.visible=true;myText.includeInLayout=true;" x="142" y="10"/> <mx:Button label="Button" click="checkbox.visible = !checkbox.visible; color.visible = !color.visible" x="31" y="93"/> <mx:ColorPicker id="color" creationComplete="color.visible = false" includeInLayout="{color.visible}" x="157" y="93"/> <mx:CheckBox label="Checkbox" id="checkbox" creationComplete="checkbox.visible = false" includeInLayout="{checkbox.visible}" x="215" y="93"/> <mx:HBox x="227" y="234" width="100%" height="16%" id="hbox" creationComplete="hbox.visible = false" includeInLayout="{false}" backgroundColor="red"> </mx:HBox> <mx:Button x="31" y="249" label="hid" click="hbox.visible=!hbox.visible; hbox.includeInLayout=false"/> </mx:Panel></mx:Application>