开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜