Hi i created listview using setlistadapter in java file.by without using xml layout i created listview but i want to set background color for listview.how to set it??
Asked
Active
Viewed 67 times
1 Answers
0
Please read http://developer.android.com/reference/android/view/View.html
ListView listView = getListView();
//set background to color
listView.setBackgroundColor(#FF888888);
//set background to Drawable
listView.setBackgroundDrawable(myDrawable);
//set background to Resource
listView.setBackgroundResouce(R.id.my_res_id);

Keshi
- 906
- 10
- 23