开发者

Flex HorizontalLayout - hide child element

I have a spark group with layout set to horizontal. The group contains a bunch of buttons and custom controls (it's kind of like a 开发者_如何学编程toolbar).

Every now and then I need to conditionally hide a couple of the elements in the toolbar.

I can set the visibile attribute to false and it hides it, but the layout doesn't change, it leave a big blank gap.

I would like the horizontal layout group to re-arrange the items so that it doesn't leave a gap where the invisible items are.

Is it possible?

Is there an attribute I can use on my element to tell the layout to ignore them and redraw itself?


You will want to set includeInLayout to false or bind it to the visible property. This will make sure that when it is invisible it is not accounted for in the layout.

<s:Label text="Test" 
    id="myLabel" 
    includeInLayout="{myLabel.visible}" 
    visible="false" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜