-1

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??

vijay
  • 3
  • 1

1 Answers1

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