flex includeInLayout

flex includeInLayout 隐藏是否参与布局

一般设置组件的visible=false;组件的位置还留着

当希望组件隐藏,同时自动布局清空组件的位置;

ComponentId.includeInLayout=false;

<mx:VBox>
        <mx:Panel id="p1" 
            title="Panel 1" 
            backgroundColor="#FF0000"/>
        <mx:Panel id="p2" 
            title="Panel 2" 
            backgroundColor="#00FF00"/>
        <mx:Panel id="p3" 
            title="Panel 3" 
            backgroundColor="#0000FF"/>
    </mx:VBox>

    <mx:HBox>
        <mx:Button label="Toggle Panel 2 Visible" 
            click="{p2.visible=!p2.visible;}"/>
        <mx:Button label="Toggle Panel 2 in Layout" 
            click="{p2.includeInLayout=!p2.includeInLayout;}"/>
    </mx:HBox>

 

 

 

你可能感兴趣的:(include)