flex组件学习——TileGroup

TileGroup组件可以很好的用来行列对齐

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- Simple example to demonstrate the Spark Group component. -->
  3. <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
  4.              xmlns:s="library://ns.adobe.com/flex/spark"
  5.              xmlns:mx="library://ns.adobe.com/flex/mx" >
  6.     
  7.     <s:Panel title="TileGroup Component Example"
  8.              width="75%" height="75%"
  9.              horizontalCenter="0" verticalCenter="0"> 
  10.         <s:VGroup left="10" right="10" top="10" bottom="10">
  11.             
  12.             <s:TileGroup horizontalGap="40" verticalGap="4" requestedColumnCount="3">
  13.                 <s:Button label="1" width="50" height="50" />
  14.                 <s:Button label="2" width="50" height="50" />
  15.                 <s:Button label="3" width="50" height="50" />
  16.                 <s:Button label="4" width="50" height="50" />
  17.                 <s:Button label="5" width="50" height="50" />
  18.                 <s:Button label="6" width="50" height="50" />
  19.                 <s:Button label="7" width="50" height="50" />
  20.                 <s:Button label="8" width="50" height="50" />
  21.                 <s:Button label="9" width="50" height="50" /> 
  22.             </s:TileGroup>
  23.             
  24.             <s:TileGroup id="test" horizontalGap="120" verticalGap="20" >
  25.                 <s:VGroup id="vGroup">
  26.                     <s:HGroup id="hGroup1">
  27.                         <s:Button label="1" width="50" height="50" />
  28.                         <s:Button label="2" width="50" height="50" />
  29.                         <s:Button label="3" width="50" height="50" />
  30.                     </s:HGroup>    
  31.                     <s:HGroup id="hGroup2">
  32.                         <s:Button label="4" width="50" height="50" />
  33.                         <s:Button label="5" width="50" height="50" />
  34.                         <s:Button label="6" width="50" height="50" />
  35.                         <s:Button label="7" width="50" height="50" />
  36.                         <s:Button label="8" width="50" height="50" />
  37.                         <s:Button label="9" width="50" height="50" /> 
  38.                     </s:HGroup>
  39.                 </s:VGroup>
  40.             </s:TileGroup>
  41.             
  42.         </s:VGroup>
  43.     </s:Panel>
  44.     
  45. </s:Application>
效果图:
注意:第二个TileGroup的horizontalGap设置的值没有用啊

flex组件学习——TileGroup

你可能感兴趣的:(xml,Flex)