2 u012932359 u012932359 于 2014.12.01 21:26 提问

Flex combox icon怎么居中

<?xml version="1.0" encoding="utf-8"?>
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
creationComplete="aaa()">
fx:Declarations
<!-- Place non-visual elements (e.g., services, value objects) here -->
/fx:Declarations

<fx:Script>
    <![CDATA[
        import mx.collections.ArrayCollection;
        import mx.events.DropdownEvent;
        [Bindable]
        private var list:ArrayCollection = new ArrayCollection();

        [Embed(source="sts_located.gif")]
        private var aaaCls:Class;
        [Embed(source="sts_partial.gif")]
        private var bbbCls:Class;
        [Embed(source="sts_unfilled.gif")]
        private var cccCls:Class;

        private function aaa():void{
            list.addItem({data:"aaa",label:"aaa"});
            list.addItem({data:"bbb",label:"bbb"});
            list.addItem({data:"ccc",label:"ccc"});
        }

        protected function combobox1_openHandler(event:DropdownEvent):void
        {
            statusCombox.dropdown.iconFunction=getIcon;
            statusCombox.dropdown.horizontalCenter=0;
            statusCombox.dropdown.verticalCenter=0;
        }
        private function getIcon(item:Object):Class{
            if(item.data=="aaa"){
                return aaaCls;
            }else if(item.data=="bbb"){
                return bbbCls;
            }else if(item.data=="ccc"){
                return cccCls;
            }else{
                return null;
            }
        }

    ]]>
</fx:Script>
<mx:ComboBox id="statusCombox" x="198" y="97" dataProvider="{list}" open="combobox1_openHandler(event)"/>

/s:Application

如上,icon和text是不垂直对齐的,怎么才能对其

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!