开发者

How to remove the icon indent in Flex control Menu?

开发者 https://www.devze.com 2022-12-09 06:21 出处:网络
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 m

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!

0

精彩评论

暂无评论...
验证码 换一张
取 消