Flex中如何通过给alternatingItemColors样式设置一个颜色数组使树Tree节点颜色交替的例子
By Minidxer | December 23, 2008
接下来的例子演示了Flex中如何通过给alternatingItemColors样式,设置一个颜色数组使树Tree节点颜色交替。
让我们先来看一下Demo(可以右键View Source或点击这里察看源代码):
下面是完整代码(或点击这里察看):
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
- layout="vertical"
- verticalAlign="middle"
- backgroundColor="white">
- <mx:XMLListCollection id="xmlListColl">
- <mx:source>
- <mx:XMLList>
- <node label="One">
- <node label="One.1" />
- <node label="One.2" />
- <node label="One.3" />
- </node>
- <node label="Two">
- <node label="Two.1" />
- <node label="Two.2" />
- <node label="Two.3" />
- </node>
- </mx:XMLList>
- </mx:source>
- </mx:XMLListCollection>
- <mx:Tree id="tree"
- dataProvider="{xmlListColl}"
- labelField="@label"
- alternatingItemColors="[#DFDFDF,#EEEEEE]"
- rowCount="4"
- width="300" />
- </mx:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
Tree |
No Comments » |
Tags: alternatingItemColors, Tree.