Display List Items with different background colors in android
How can i display list items(ListView) with different colors i开发者_如何学编程n android ?
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.
Refer this : Creating a ListView with Alternating Colors in Android
You need to write your custom adapter. For example, inherit a CursorAdapter and override the getView
method, there you may get the particular layout for that row of item and set a custom background to it.
精彩评论