<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
    
    <fx:Script>
        <![CDATA[
            private var buttonBarXML:XML = describeType(ButtonBar);
            protected function labelFun(item:Object):String
            {
                //trace(buttonBarXML.factory.toString());
var cat:String = item.label.toUpperCase(); var len:uint = buttonBarXML.factory.child(item.data).length(); return item.label + " (" + len + ")"; } ]]> </fx:Script> <fx:Declarations> <!-- 将非可视元素(例如服务、值对象)放在此处 --> <s:ArrayList id="arr"> <fx:Array> <fx:Object label="Accessors" data="accessor"/> <fx:Object label="Methods" data="method"/> <fx:Object label="ImplementsInterface" data="implementsInterface"/> <fx:Object label="Variable" data="variable"/> </fx:Array> </s:ArrayList> </fx:Declarations> <s:ButtonBar id="buttonBar" dataProvider="{arr}" labelFunction="labelFun" /> </s:Application>

 

相关文章:

  • 2022-01-13
  • 2021-07-05
  • 2022-01-22
  • 2021-12-01
  • 2021-09-02
  • 2021-07-28
  • 2021-08-25
  • 2021-06-23
猜你喜欢
  • 2021-07-17
  • 2021-05-19
  • 2021-11-04
  • 2021-07-06
  • 2021-10-10
  • 2021-07-09
  • 2021-08-02
相关资源
相似解决方案