设置 Flex 图例项的填充样式不起作用
我一直在尝试(但无济于事)将 Flex 中图例项目的背景颜色设置为我选择的颜色。
不幸的是,它似乎不起作用。
我获得了对相关 legendItem 的引用,然后像这样设置填充样式:
var legendItem:LegendItem = event.item;
var legendItemColor:SolidColor = new SolidColor(0x00FF00, 0.5);
legendItem.setStyle("fill", legendItemColor);
我可以设置图例项的其他样式,但由于某种原因,这不起作用。
任何帮助将不胜感激。
提前致谢。
I have been trying (but to no avail) to set the background color of a legend item in Flex to a color of my choosing.
Unfortunately, it doesn't seem to be working.
I obtain a reference to the legendItem in question and then set the fill style like so:
var legendItem:LegendItem = event.item;
var legendItemColor:SolidColor = new SolidColor(0x00FF00, 0.5);
legendItem.setStyle("fill", legendItemColor);
I am able to set other styles of the legend item but, for some reason, this isn't working.
Any help would be greatly appreciated.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看此示例 http://blogs.adobe.com/flexdoc/2008/07 /customized_legend_layout.html
Check out this example http://blogs.adobe.com/flexdoc/2008/07/customized_legend_layout.html
通过设置 legendItem 的 opaqueBackground 属性设法获得我正在寻找的效果。
确实没有意义,我什至找到了一个 示例 其中 setStyle使用了填充并且似乎对他们有用。
哦,好吧,只要它有效!
Managed to get the effect I was looking for by setting the opaqueBackground property of the legendItem.
Doesn't really make sense and I had even found an example where setStyle of fill was used and seemed to work for them.
Oh well, as long as it works!