views:

163

answers:

2

I cant quite understand why two vertical label components dont appear right under each other. There seems to be a lot of space between them, is there anyway to get this space removed as setting padding makes no difference at all.

For example, take this layout code:

<mx:VBox>
<mx:Label text="Title" paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0" />
<mx:Label text="Second bit of text I want to appear right under the first" paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0" />
</mx:VBox>
A: 

Margin = 0?

gargantaun
I cant seem to add 'margin' to a text or label component
Dan
+2  A: 

You need to set the VBox's verticalGap to 0 or a suitable value.

dirkgently
I found "verticalGap" on a VBox component, its much better (setting it to 0) but still not perfect. Also I cant seem to add this property to a programmatically created component: "var contentLinkBox:VBox = new VBox();"
Dan
Aha, you set it as a style: contentLinkBox.setStyle("verticalGap", 0);
Dan