Flex的Tree的Icon问题,求各位帮忙看看啊,谢谢了
我的代码是这样的,但是那个tree 的ItemIcon属性设置后没看到任何效果,图片路径是对的,不知道什么问题,运行后还是系统默认的那套Icon,求各位看看解决一下了,谢谢了!
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<s:layout>
<s:BasicLayout/>
</s:layout>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.controls.treeClasses.TreeItemRenderer;
import mx.events.FlexEvent;
[Bindable]
[Embed(source="cok.jpg")]
public var imgClass1:Class;
[Bindable]
[Embed(source="ic1.jpg")]
public var imgCls:Class;
[Bindable]
[Embed(source="cs.jpg")]
public var itemIcon:Class;
]]>
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
<s:XMLListCollection xmlns="" id="xmlSource">
<s:source>
<fx:XMLList>
<Organization>
<Node label='Root' value='1'>
<Node label='node1' value='2'>
<Node label='node1node1' value='6'>
<Node label='ddd' value='14'></Node>
</Node>
</Node>
<Node label='asasd2' value='3'>
<Node label='aaaaa' value='7'></Node>
</Node>
<Node label='ccas' value='4'>
<Node label='cawea1' value='8'></Node>
</Node>
<Node label='ccas2' value='5'>
<Node label='gasd1' value='9'></Node>
<Node label='sdfas2' value='10'></Node>
</Node>
</Node>
</Organization>
</fx:XMLList>
</s:source>
</s:XMLListCollection>
</fx:Declarations>
<mx:Tree x="59" y="46" width="220" height="456" id="tree1"
dataProvider="{xmlSource}"
labelField="@label" showRoot="false" itemIcons="{imgCls,itemIcon}"></mx:Tree>
</s:Application>
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<s:layout>
<s:BasicLayout/>
</s:layout>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.controls.treeClasses.TreeItemRenderer;
import mx.events.FlexEvent;
[Bindable]
[Embed(source="cok.jpg")]
public var imgClass1:Class;
[Bindable]
[Embed(source="ic1.jpg")]
public var imgCls:Class;
[Bindable]
[Embed(source="cs.jpg")]
public var itemIcon:Class;
]]>
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
<s:XMLListCollection xmlns="" id="xmlSource">
<s:source>
<fx:XMLList>
<Organization>
<Node label='Root' value='1'>
<Node label='node1' value='2'>
<Node label='node1node1' value='6'>
<Node label='ddd' value='14'></Node>
</Node>
</Node>
<Node label='asasd2' value='3'>
<Node label='aaaaa' value='7'></Node>
</Node>
<Node label='ccas' value='4'>
<Node label='cawea1' value='8'></Node>
</Node>
<Node label='ccas2' value='5'>
<Node label='gasd1' value='9'></Node>
<Node label='sdfas2' value='10'></Node>
</Node>
</Node>
</Organization>
</fx:XMLList>
</s:source>
</s:XMLListCollection>
</fx:Declarations>
<mx:Tree x="59" y="46" width="220" height="456" id="tree1"
dataProvider="{xmlSource}"
labelField="@label" showRoot="false" itemIcons="{imgCls,itemIcon}"></mx:Tree>
</s:Application>
...全文
相关推荐
flex tree icon
NULL 博文链接:https://demojava.iteye.com/blog/1405668
flex tree 修改icon方法
flex 修改 tree的icon,根据数据源root 中不同的参数修改不同的图片。
可编辑el-tree样式功能修改:修改icon、可编辑input、修改下拉展开icon位置
文章:【Vue入门实践】可编辑el-tree样式功能修改:修改icon、可编辑input、修改下拉展开icon位置 对应源码文件
flex 树状图
flex 做的一个树状图 图例清新 结构清晰
flex树自定义节点图标
flex树自定义节点图标的页面及自定义树形组件源码


