• Alternating row colors in a Flex Tree control using the depthColors style


    The following example shows how you can alternate item colors based on the item’s depth in a Flex Tree control by setting the depthColors style to an array of colors
    <?xml version="1.0" encoding="utf-8"?>
    <!-- http://blog.flexexamples.com/2007/11/27/alternating-row-colors-in-a-flex-tree-control-using-the-depthcolors-style/ -->
    <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.1.1">
                                
    <node label="One.1.1.1">
                                    
    <node label="One.1.1.1.1" />
                                
    </node>
                            
    </node>
                        
    </node>
                        
    <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"
                depthColors
    ="[#FFFFFF, #EEEEEE, #DDDDDD, #CCCCCC, #BBBBBB, #AAAAAA]"
                rowCount
    ="4"
                width
    ="300" />

    </mx:Application>

  • 相关阅读:
    Yahoo军规的学习
    从github上拉取代码速度慢的解决方案
    hosts文件介绍
    Windows系统下用nginx服务器部署页面
    前端开发面试题
    IDEA中maven无法拉下依赖问题的解决
    利用补丁永久破解IDEA
    OC项目中常用第三方库和框架介绍
    [暑假集训]开训复健练习赛 G
    [暑假集训]开训复健练习赛 D
  • 原文地址:https://www.cnblogs.com/taobataoma/p/1034842.html
Copyright © 2020-2023  润新知