如何设置不同的背景颜色列表视图的每一行?视图、如何设置、颜色、背景

由网友(执笔画卿颜♧)分享简介:我想列表视图中的每一行中设置不同的背景颜色?我用列表视图的自定义适配器。它应该是出现时活动loads.static不同颜色的行I want to set different background color in each row of listview ? I used custom adapter for lis...

我想列表视图中的每一行中设置不同的背景颜色?我用列表视图的自定义适配器。它应该是出现时活动loads.static不同颜色的行

I want to set different background color in each row of listview ? I used custom adapter for listview. It should be appear when activity loads.static different color row.

推荐答案

正如你说,你有使用自定义适配器列表视图那么你需要做的是如下。 在 getView 适配器的方法,你需要设置你的列表行XML的父视图的背景色。

As you said that you have use Custom adapter for listview then what you need to do is below. in getView method of your adapter you need to set background color of your list row xml's parent view.

阅读全文

相关推荐

最新文章