Flex中如何改变FormItem容器的指示器(indicator)皮肤的例子

By Minidxer | October 14, 2008

接下来的例子演示了Flex中如何改变FormItem容器的指示器(indicator)皮肤。

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


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

Download: main.mxml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  3.         layout="vertical"
  4.         verticalAlign="top"
  5.         backgroundColor="white">
  6.  
  7.     <mx:Style>
  8.         FormItem {
  9.             indicatorSkin: Embed(source="assets/asterisk_yellow.png");
  10.             indicatorGap: 24; /* pixels */
  11.         }
  12.  
  13.         FormItemLabel {
  14.             textAlign: left;
  15.         }
  16.     </mx:Style>
  17.  
  18.     <mx:Form>
  19.         <mx:FormHeading label="FORM HEADING" />
  20.         <mx:FormItem label="Name:" required="true">
  21.             <mx:TextInput />
  22.         </mx:FormItem>
  23.         <mx:FormItem label="Email:" required="true">
  24.             <mx:TextInput />
  25.         </mx:FormItem>
  26.         <mx:FormItem label="Phone number:">
  27.             <mx:TextInput />
  28.         </mx:FormItem>
  29.     </mx:Form>
  30.  
  31. </mx:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

Topics: FormItem | No Comments » | 291 views Tags: , , , ,

Search Posts

赞助商链接

Archives