阅读:3506次   评论:1条   更新时间:2011-06-01    
运行以下例子请注意:在src下建一个assets目录,找几张图片放进去,然后把代码里引用的图片改成你的图片,就可以运行了
<?xml version="1.0"?>
<!-- Simple example to demonstrate the HorizontalList Control. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

    <mx:Script>
        <![CDATA[
             
             [Bindable]
             [Embed(source="assets/Nokia_6630.png")]
             public var phone1:Class;
             
             [Bindable]
             [Embed(source="assets/Nokia_6680.png")]
             public var phone2:Class;
             
             [Bindable]
             [Embed(source="assets/Nokia_7610.png")]
             public var phone3:Class;
	     
             [Bindable]
	         [Embed(source="assets/Nokia_lg_v_keypad.png")]
             public var phone4:Class;

             [Bindable]
	         [Embed(source="assets/Nokia_sm_v_keypad.png")]
             public var phone5:Class;
        ]]>
    </mx:Script>

    <mx:Panel title="HorizontalList Control Example" height="75%" width="75%" 
        paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">

        <mx:Label width="100%" color="blue"
           text="这是水平方向的List." fontSize="12"/>

        <mx:HorizontalList id="CameraSelection" height="250" columnCount="3" columnWidth="125">
            <mx:dataProvider>
                <mx:Array>
                    <mx:Object label="Nokia 6630" icon="{phone1}"/>
                    <mx:Object label="Nokia 6680" icon="{phone2}"/>
                    <mx:Object label="Nokia 7610" icon="{phone3}"/>
                    <mx:Object label="Nokia LGV" icon="{phone4}"/>
                    <mx:Object label="Nokia LMV" icon="{phone5}"/>
                </mx:Array>
            </mx:dataProvider>
        </mx:HorizontalList>
        
    </mx:Panel>
</mx:Application>

评论 共 1 条 请登录后发表评论
1 楼 shaosjm 2010-10-19 17:59
[i][/i][u][/u]
引用
[img][/img]

字体颜色: 标准深红红色橙色棕色黄色绿色橄榄青色蓝色深蓝靛蓝紫色灰色白色黑色 字体大小: 标准1 (xx-small)2 (x-small)3 (small)4 (medium)5 (large)6 (x-large)7 (xx-large) 对齐: 标准居左居中居右

发表评论

您还没有登录,请您登录后再发表评论

文章信息

  • wxmfly在2009-06-02创建
  • wxmfly在2011-06-01更新
  • 标签: horizontallist, flex, flex3, list
Global site tag (gtag.js) - Google Analytics