Flex Gumbo中如何利用horizontalAlign属性设置FxList横向对齐方式的例子

By Minidxer | July 17, 2009

接下来的例子演示了Flex Gumbo中如何利用horizontalAlign属性,设置FxList横向对齐方式。

让我们先来看一下Demo可以点击这里察看源代码):


下面是完整代码(或点击这里察看):

Download: main.mxml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Application name="FxList_layout_VerticalLayout_horizontalAlign_test"
  3.         xmlns="http://ns.adobe.com/mxml/2009"
  4.         backgroundColor="white">
  5.  
  6.     <ApplicationControlBar dock="true">
  7.         <Form styleName="plain">
  8.             <FormItem label="horizontalAlign:">
  9.                 <ComboBox id="comboBox"
  10.                         dataProvider="[left,center,right,justify,contentJustify]"
  11.                         selectedIndex="4" />
  12.             </FormItem>
  13.         </Form>
  14.     </ApplicationControlBar>
  15.  
  16.     <FxList id="list" width="200">
  17.         <layout>
  18.             <VerticalLayout gap="0"
  19.                     horizontalAlign="{comboBox.selectedItem}"
  20.                     requestedRowCount="6" />
  21.         </layout>
  22.         <dataProvider>
  23.             <ArrayCollection>
  24.                 <String>1. The</String>
  25.                 <String>2. Quick</String>
  26.                 <String>3. Brown</String>
  27.                 <String>4. Fox</String>
  28.                 <String>5. Jumps</String>
  29.                 <String>6. Over</String>
  30.                 <String>7. The</String>
  31.                 <String>8. Lazy</String>
  32.                 <String>9. Dog</String>
  33.             </ArrayCollection>
  34.         </dataProvider>
  35.     </FxList>
  36.  
  37. </Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

Topics: FxList, Gumbo | No Comments » | Tags: ,

Search Posts