更改 TileList 组件中单个缩略图的外观
我正在尝试使用 TileList 组件创建缩略图列表,到目前为止效果很好。有没有办法改变组件内单个 ImageCell 的外观。
我将缩略图数据作为 XML 引入,并且有一个属性来判断它是否是“新”图像。我希望它在我的应用程序中的各个缩略图上显示一个小徽章。
我应该注意,我创建了 ImageCell 类的子类(实现 ICellRenderer)来设置我的自定义皮肤,但是当我尝试在此处添加条件代码(检查我设置的“新”参数)时,它根本不起作用(没有错误)消息)。
有人对如何实现这一目标有任何想法吗?
!
- 谢谢
I'm trying to create a listing of thumbnails using the TileList component, and so far it's working great. Is there a way to change the appearance of a single ImageCell within the component.
I'm bringing in the thumbnail data as XML, and I have an attribute for whether it's a "new" image or not. I would like it to display a small badge over the individual thumbnail in my application.
I should note that I made a subclass of the ImageCell class (implementing ICellRenderer) to set my custom skins, but when I tried adding conditional code here (checking for the "new" parameter I set, It simply doesn't work (no error messages).
Does anyone have any ideas on how to achieve this?
Thanks!
- Scott
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您还需要扩展 TileListData 并添加 isNew 属性或其他内容。
一个快速的解决方法是使用 icon 属性来存储您的布尔值,因为它是 ListData.as 中的一个对象,然后在您的类中访问它并使用它来切换 NEW 的可见性图形。
例如
,这是一些测试时间线代码:
HTH
You need to also extend TileListData and add an isNew property or something.
A quick workaround is to use the icon property to store your Boolean, since it's an Object in ListData.as, then in your class, access that and use it to toggle the visibility of your NEW graphic.
e.g.
and here is some test timeline code:
HTH
我假设您正在使用 itemRenderer 来渲染缩略图。您可以在绑定内使用条件来决定显示哪个缩略图,或使用“新属性”隐藏/显示第二个图像。例如,
希望这有帮助,包括代码也可能有帮助。
I assume you are using an itemRenderer for the rendering of the thumbnail. You can use conditionals inside the binding to decide which thumbnail to show or use the "new property" to hide/show a 2nd image. For example,
Hope this helps, including code might help as well.