[英]How can I change the size of icons in the Tree control in Flex?
我使用SVG图形嵌入了Flex应用程序
package MyUI
{
public class Assets
{
[Embed(source="/assets/pic.svg"]
[Bindable]
public static var svgPic:Class;
}
}
然后使用我自己的一些代码扩展Tree类,在将节点添加到数据提供程序时设置图标:
public class MyTree extends Tree
{
public function MyTree()
{
// ...
this.iconField = "svgIcon";
// ...
this.dataProvider = new ArrayCollection;
this.dataProvider.addItem({ /* ... */ svgIcon: MyUI.Assets.svgPic /* ... */ });
// ...
}
}
现在我要做两件事:
我阅读了Embed标签中有关9切片缩放属性的Flex文档,但是我认为这不是我想要的。
编辑:
我未成功检查SO建议的“类似问题”,其中包括:
子类mx.controls.treeClasses.TreeItemRenderer,并使其图标调整为所需的尺寸,或者使用与TreeItemRenderer相同的接口创建自己的项目渲染器实现。 使用itemRenderer
属性设置自定义项目渲染器:
exampleTree.itemRenderer = new ClassFactory( ExampleCustomItemRendererClass );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.