Flex itemrenderer 禁用翻转但保持交替颜色
有没有办法在不丢失交替背景颜色的情况下自定义项目渲染器的翻转和选定颜色?
当我将 autoDrawBackground 标志设置为 false 时,翻转效果会停止,但由于某种原因,也不会绘制交替背景。
我想创建一个渲染器,它在悬停状态上绘制白色边框,在选定状态上绘制黄色边框,而不是默认的翻转颜色。 我还想保留我在列表中设置的交替背景颜色。
有什么建议吗?
Is there a way to customize the rollover and selected colors of an item renderer without losing the alternating background colors?
When i set the autoDrawBackground flag to false the roll over effects stops but for some reason the alternating background is also not drawn.
I would like to create a renderer which draws a white border on state hovered and a yellow border on selected instead of the default rollover color.
I would also like to keep my alternating background colors i set on the list.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 ItemRenderer 类的“itemIndex”属性来绘制背景。例如:
将在红色和绿色行之间交替显示背景图形,如下所示:
使用这种技术,您显然也可以做更复杂的事情,例如渐变、Alpha 效果等。
You could use the 'itemIndex' property of the ItemRenderer class to draw the background. For instance:
would alternate between red and green rows for a background graphic like this:
Using this technique, you could obviously do more complex things too, like gradients, alphas effects and so on.
如果我没有误解你的问题,我认为这就是你所需要的:)
I think that's what you need if i didn't misunderstand your question :)