【问题标题】:adobe flex how to remove space between BOX, VBOX, HBOXadobe flex如何删除BOX、VBOX、HBOX之间的空间
【发布时间】:2013-06-01 06:27:22
【问题描述】:
<mx:VBox horizontalGap="0" verticalGap="0" height="84" width="164" verticalAlign="middle" styleName="amount">
    <s:Label text="text" width="100%" textAlign="center"/>
    <s:Label text="text" width="100%" textAlign="center"/>
</mx:VBox>
<mx:Box width="1" height="84" borderStyle="solid">

</mx:Box>
<mx:VBox horizontalGap="0" verticalGap="0" height="84" width="144" verticalAlign="middle" styleName="amount">
    <s:Label text="text" width="100%" textAlign="center"/>
    <s:Label text="text" width="100%" textAlign="center"/>
</mx:VBox>

我尝试过使用horizo​​ntalGap,并将VerticalGap设置为0,但是不起作用,如何消除mx框之间的间隙?

【问题讨论】:

  • 也许尝试将边距设置为 0 ?

标签: flash apache-flex actionscript


【解决方案1】:

“gap”属性指定在布局 Box 的子项时应应用多少间隙。

例如,您的代码下面的间隙属性为 0,这意味着这个 VBox 应该布局它的子元素(标签),没有垂直间隙(在这种情况下,水平间隙是无用的,因为我们正在谈论关于VBox)。

<mx:VBox horizontalGap="0" verticalGap="0" height="84" width="164" verticalAlign="middle" styleName="amount">
    <s:Label text="text" width="100%" textAlign="center"/>
    <s:Label text="text" width="100%" textAlign="center"/>
</mx:VBox>

那么,包含上述所有盒子的容器是什么?如果该容器是VBox,则将该父容器对象的verticalGap 设置为0。如果是HBox,则将其horizontalGap 设置为0。

【讨论】: