显示列表项,在Android的不同背景颜色 [英] Display List Items with different background colors in android

查看:465
本文介绍了显示列表项,在Android的不同背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在android系统显示列表项(ListView控件)用不同颜色?

How can i display list items(ListView) with different colors in android ?

推荐答案

创建你要显示的颜色和呼叫的整数值数组的 setBackgroundColor()方法在你的 getView() bindView()您自定义适配器的方法。

Create an Array of integer values of the color you wants to display and the call the setBackgroundColor() method in your getView() or bindView() method of your Custom Adapter.

转寄此:<一href=\"http://ykyuen.word$p$pss.com/2010/03/15/android-%E2%80%93-applying-alternate-row-color-in-listview-with-simpleadapter/\"相对=nofollow>与Android的的交替颜色创建一个ListView

Refer this : Creating a ListView with Alternating Colors in Android

这篇关于显示列表项,在Android的不同背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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