Flex Gumbo中如何通过contentBackgroundColor样式设置TextInput背景颜色的例子

By Minidxer | July 19, 2009

接下来的例子演示了Flex Gumbo中如何通过contentBackgroundColor样式,设置TextInput背景颜色。

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


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

Download: main.mxml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:Application name="Spark_TextInput_contentBackgroundColor_test"
  3.         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/halo">
  6.  
  7.     <mx:ApplicationControlBar width="100%" cornerRadius="0">
  8.         <mx:Form styleName="plain">
  9.             <mx:FormItem label="contentBackgroundColor:">
  10.                 <mx:ColorPicker id="colorPicker"
  11.                         selectedColor="white" />
  12.             </mx:FormItem>
  13.         </mx:Form>
  14.     </mx:ApplicationControlBar>
  15.  
  16.     <s:TextInput id="textInput"
  17.             text="The quick brown fox jumps over the lazy dog."
  18.             contentBackgroundColor="{colorPicker.selectedColor}"
  19.             horizontalCenter="0"
  20.             verticalCenter="0" />
  21.  
  22. </s:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

Topics: Gumbo, TextInput | No Comments » | 280 views Tags: ,

Search Posts