I know it’s super simple, but I’ve been banging my head on text layout for a couple of hours. I wanted 2 text boxes to have less space between them (leading) than the default. After trying many approaches, I finally figured out that I can set a negative paddingBottom to achieve the desired effect.
Flex Code:
<mx:VBox>
<mx:Text text="Line 1" styleName="line1Style"/>
<mx:Text text="Line 2" styleName="line2Style"/>
</mx:VBox>
CSS:
.line1Style {
fontSize: 38;
fontWeight: bold;
paddingBottom:-10;
}
.line2Style {
fontSize: 16;
}
While investigating this effect, I also found some other interesting layout resources:
Adobe’s Quickstart guide to positioning
Kevin Hoyt’s review of positioning in Flex