Question Detail

How to change Listview Background and Text Color in Xml ?


Thread Reply

Anonymous

- 7 months ago

You can't change Text Color in ListView directly from the XML file. you have to Create layout and import that TextView Layout in Your adapter and set Style on y our TextView that will visible on your ListView Item TextView Style.

You can change ListView Background color through XML eg. android:background="#00FFFF"

 

For your Custome layout implement in your ListView

ArrayAdapter<String> adapter = new ArrayAdapter<String>(MainActivity.this, R.layout.custom_textview, aa);
lv.setAdapter(adapter);