How to remove the icon indent in Flex control Menu?
I use PopUpButton object and inside a Menu object. For some reason it has default text indent (e开发者_运维知识库ven when an icon is not defined). How can I remove this indent?
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!
精彩评论