在flex中怎么使用List和Tree

<? xml version="1.0" encoding="utf-8" ?>    <!--   版本号(必选)和编码格式(可选)    -->
< mx:Application  xmlns:mx ="http://www.adobe.com/2006/mxml"  layout ="absolute" >     <!--  layout="absolute"  布局方式:绝对定位  -->
    
<!--  定义一数组,数组包含四个元素  -->
    
< mx:Array  id ="array1" >
        
< mx:String > 111 </ mx:String >
        
< mx:String > 222 </ mx:String >
        
< mx:String > 333 </ mx:String >
        
< mx:String > 444 </ mx:String >
    
</ mx:Array >
    
< mx:List  dataProvider ="{array1}"  width ="50"  x ="2"  y ="10" ></ mx:List >
    
<!--  dataProvider属性表示List组件的数据源   -->
    
    
<!--
    <mx:Array id="array2"></mx:Array>
    <mx:Script>
        <![CDATA[
            public var array2:Array=new Array();
            array2.push("555");
            array2.push("666");
            array2.push("777");
            array2.push("888");
        ]]>
    </mx:Script>
    <mx:List dataProvider="{array2}" width="50"></mx:List>
    
-->
    
    
< mx:XML  xmlns =""  id ="myData" >
        
< node  label ="资料" >
            
< node  label ="music" >
                
< node  label ="古典" />
                
< node  label ="摇滚" />
                
< node  label ="民歌" />
            
</ node >
            
< node  label ="Movie" >
                
< node  label ="法国" />
                
< node  label ="美国" />
            
</ node >
        
</ node >
    
</ mx:XML >
    
< mx:Tree  labelField ="@label"  dataProvider ="{myData}"  x ="60"  y ="10"  width ="180" ></ mx:Tree >
</ mx:Application >
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值