如何在运行时为列表视图赋予颜色? [英] How I give color to list view at run time?

查看:86
本文介绍了如何在运行时为列表视图赋予颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有布局模板,里面有桌子..
现在,我将数据库中的数据绑定到列表视图.
我的数据库中有成员类型表.
int表示有成员类型和成员名称是两个字段.

我想根据从数据库中获取的数据对表格进行上色.
意味着如果我获得银牌会员类型而不是我想要将颜色表显示为红色,并且如果我得到金牌会员类型而不是我想要将它们显示为其他颜色...
提前感谢...

I have layout template and there is table in it..
now I Bind data from database to list view.
I have member type table in database.
int that there is member type and member name are two field.

I want to color table as per data i got from database.
Means if I got Silver member type than I want to color table as red and if I got Gold member type than I want to display them as different color...

Thnks in advance...

推荐答案

查看Listview提供的方式和内容 ^ ].

您需要在以下事件中编写代码[a] [ ^ ].
陷阱成员类型,然后根据该成员类型给出所需的颜色.
Look at how and what all Listview provides here[^].

You need to write code in the following event[^].
Trap the member type and then based on that give the desired color.


这篇关于如何在运行时为列表视图赋予颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆