自定义ItemRenderer常遇到的警告unable to bind to property的解决办法

<?xml version="1.0" encoding="utf-8"?>
 
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
 
<mx:Script>
 
        <![CDATA[
 
                import mx.binding.utils.BindingUtils;
 
                
                [Bindable]
 
                private var _data:Object;
 
                [Bindable]
 
                private var _label:String;
 
                [Bindable]
 
                private var _icon:String;
 
                
                override public function set data(value:Object):void{
 
                        _label=value.label;
 
                        _icon=value.icon;
 
                        _data=value;
 
                }
 
                override public function get data():Object{
 
                        return _data;
 
                }
 
        ]]>
 
</mx:Script>
 
        <mx:Image source="{_icon}"/>
 
        <mx:Button label="{_label}"/>
 
</mx:VBox>
 

你可能感兴趣的:(itemRenderer)