![]() |
![]() |
||||||
|
|||||||
| Tags: horizontalgap, maybe |
![]() |
|
|||
|
I've got this small app that lays Labels out in an HBox. I want to decrease
the space between the Labels, but can't seem to do it. Changing horizontalGap on other containers seems to work the way i think it should, but not here. Any suggestions? <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > <mx:HBox id="navGalleryListBox" horizontalGap="0" width="395" height="18" clipContent="True" verticalScrollPolicy="off" horizontalScrollPolicy="off" verticalAlign="middle" paddingTop="0" paddingBottom="0" > <mx:Label id="firstNAV" text="1" fontFamily="Century Schoolbook L" fontSize="23" paddingLeft="0" paddingRight="0" /> <mx:Label id="secondNAV" text="2" fontFamily="Century Schoolbook L" fontSize="23" paddingLeft="0" paddingRight="0" /> </mx:HBox> </mx:Application> |
| Sponsored Links |
|
|||
|
Any reason you are using Label instead of Text?
The Text component will collapse to the size of what is in it but the label will have space on the right which is where your extra space is coming from. The label does this as part of it's standard formatting to allow it to stand off a bit from whatever it is labeling without you having to add extra formatting. If you switch your labels to simply Text components I believe you will find you get the effect you want. |
|
|||
|
Well, firstly because of this from
http://livedocs.adobe.com/flex/3/lan...rols/Text.html [Q]The Text control displays multiline, noneditable text. Use the Label control if you need only a single line of text. [/Q] But Text seems unnecessarily complicated with the whole childnode thing. (btw, can you tell I'm new to Flex?) is the padding not adjustable on Label? |
|
|||
|
I tip my hat to anyone who has actually read the livedocs first before posting
here. In most cases I would also suggested to follow the API. In this case however I would still suggest using Text as long as you understand how it will react if your HBox gets too small. I.E. it will wrap unless you have set the width to a percentage. Text subclasses Label but handles the space around itself the way I believe you are thinking a label should. The label control is more of a container that has text in it and the minimum size of the container does not honor the dimensions of the font once the width gets smaller then the height. Instead it just tends to end up square at that point. Text control honors the spacing around the font of the item inside it. So for example if there was a single character "1" in a label control with your CSS options above the width of the label control itself will be the same as the height of the character plus the top and bottom padding. But in a Text control the width is the width of the font of the character plus the left and right padding. Not sure if that is how it was intended but in my experience that is how it displays. (Sorry did not intend to explain so much just to say I still would use text.) |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise