tags:

views:

55

answers:

2

hi guyz,

 can anyone help me of changing the background color of a list view?. i am new to android and i really need to know this. any help will be appreciated.

thanks

A: 

would this help for example:

<ListView android:id="@+id/rssListView"
    android:background="#7700CC00"
    android:layout_height="wrap_content"
    android:layout_width="match_parent" />

?

ruslanoid
actually i have created a list in Java Android. and i want to change the background color through Java code.
sajjoo
+2  A: 

You can use the setBackgroundColor() method of the ListView.

totramon
but this method has a int argument. and the color numbers are started from #. and it gives an error.
sajjoo
In code the color values can be given in hex format, too, but simply replace # with 0x.
totramon
You can also use the Color class to set the color:setBackgroundColor(Color.BLACK); or whatever.
Aurora
thanks Guyz its done now. thanks alot.
sajjoo
then mark the answer as accepted by using the check mark next to it.
Axarydax