在我的Flex应用程序中,我有一个按钮,在自定义数据网格组件上方放置了以下声明。
<mx:Button id="resetButton" label="Reset" visible="true" />
按钮现在放在网格上方,我需要将它移动几个像素,以便它们之间有一点空间。
我注意到Button组件有paddingBottom
属性,但没有marginBottom
等效。
我在Google上找不到任何建议。实现这一目标的正确方法是什么?
修改
底部属性在我的情况下没有任何影响(可能是由于我们使用的布局)所以我最终用一个新的VBox组件围绕Button:
<mx:VBox paddingBottom="5">
<mx:Button id="resetButton" label="Reset" visible="true" />
</mx:VBox>
答案 0 :(得分:1)
您可以使用top, bottom, left, right
属性代替marginTop, marginBottom, marginLeft, marginRight
。 top
的功能与marginTop
<mx:Button id="btnSave"
top="50"
bottom="50"
left="50"
right="50"
click="btnSave_clickHandler(event)"
label="SAVE to File" />
愿这对你有所帮助。
答案 1 :(得分:1)
听起来你的按钮和网格已经在VBox中了。如果是这种情况,您只需在按钮后添加一个垫片即可。它比使用VBox包围一个按钮要轻得多。
<mx:Spacer height="5"/>