zoukankan      html  css  js  c++  java
  • Flex组件Repeater

    1、设计思路

    (1)新建一个应用程序;

    (2)在应用程序中,声明一个数组;

    (3)给一个Repeater,里面包含一个Button和TextInput。

    2、设计源码

    RepeaterCom.mxml:

    <?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"
    			   width="100%" height="100%">
    	<s:layout>
    		<s:BasicLayout/>
    	</s:layout>
    	
    	<fx:Declarations>
    		<s:ArrayCollection id="ac" source="{myArray}"/>
    	</fx:Declarations>
    	
    	<fx:Script>
    		<![CDATA[
    			private var myArray:Array = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16];
    		]]>
    	</fx:Script>
    	
    	<mx:VBox width="100%" height="100%"  horizontalAlign="center" verticalAlign="middle">
    		<mx:Repeater dataProvider="{ac}" startingIndex="2" count="10">
    			<mx:HBox>
    				<s:Button label="查询" click="myText[event.target.instanceIndices].text=
    						  event.target.instanceIndices.toString();"/>
    				<s:TextInput id="myText"/>
    			</mx:HBox>
    		</mx:Repeater>
    	</mx:VBox>
    	
    </s:Application>
    
    3、运行结果

    (1)初始化



    (2)点击查询

             

         改变Repeater中的下面两个属性的值,会显示不同的结果

        startingIndex="2" count="10"



  • 相关阅读:
    contest hunter5105 Cookies
    bzoj2599: [IOI2011]Race
    poj1741 Tree
    bzoj2527: [Poi2011]Meteors
    bzoj3673: 可持久化并查集 by zky&&3674: 可持久化并查集加强版
    bzoj2741: 【FOTILE模拟赛】L
    bzoj3110: [Zjoi2013]K大数查询
    bzoj1901: Zju2112 Dynamic Rankings
    bzoj2821: 作诗(Poetize)
    poj1417 True Liars
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13315639.html
Copyright © 2011-2022 走看看