I use PopUpButton object and inside a Menu object. For some reason it has default text indent (even when an icon is not defined). How can I remove this indent?
+2
A:
Someone probably has a more elegant solution, but setting the paddingLeft style of your menu to a negative number seems to work just fine (I'm using a PopUpMenuButton to illustrate, but a PopUpButton with a Menu would work just the same):
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Style>
Menu
{
paddingLeft: -12;
}
</mx:Style>
<mx:XMLList id="myData">
<node label="One"/>
<node label="Two"/>
<node label="Three"/>
</mx:XMLList>
<mx:PopUpMenuButton id="myButton" dataProvider="{myData}" label="Click Me" labelField="@label" />
</mx:Application>
Hope that helps!
Christian Nunciato
2009-10-26 23:12:47