怎么在DropdownList下面嵌入图片

  flex4 的DropdownList下拉框组件本身并不支持下拉框图片,但是可以结合条目渲染器和皮肤使其显示图片。
  
  dropdownlist皮肤代码: flex/spark" xmlns:fb="http://ns.adobe.com/flashbuilder/2009" alpha.disabled=".5" xmlns:mx="library://ns.adobe.com/flex/mx"> style. */ static private const contentFill:Array=["bgFill"]; /** * @private */ override public function get contentItems():Array { return contentFill } ; /** * @private */ override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { if (getStyle("borderVisible") == false) { if (border) border.visible=false; if (background) { background.left=background.top=background.right=ba ckground.bottom=0; } if (scroller) scroller.minViewportInset=0; } else { if (border) border.visible=true; if (background) { background.left=background.top=background.right=ba ckground.bottom=1; } if (scroller) scroller.minViewportInset=1; } if (dropShadow) dropShadow.visible=getStyle("dropShadowVisible"); openButton.setStyle("cornerRadius", getStyle("cornerRadius")); if (borderStroke) { borderStroke.color=getStyle("borderColor"); borderStroke.alpha=getStyle("borderAlpha"); } super.updateDisplayList(unscaledWidth, unscaledHeight); } ]]--> In a custom skin class that uses transitions, set the itemDestructionPolicy property to none. --> 条目渲染器: flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" autoDrawBackground="true" creationComplete="itemrenderer1_creationCompleteHa ndler(event)"> 其使用代码: positionDDL.setStyle("skinClass", DropdownListSkin); positionArray=new ArrayCollection([{label: "最前", source: "../resources/bringtofront.png"}, {label: "前移", source: "../resources/bringforward.png"}, {label: "后移", source: "../resources/sendbackward.png"}, {label: "最后", source: "../resources/sendtoback.png"}]) positionDDL.dataProvider=positionArray; positionDDL.selectedIndex=0;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值