Question Detail

Change Listview color in xml android

5 years ago Views 1323 Visit Post Reply

How to change Listview Background and Text Color in Xml ?

Thread Reply


- 5 years 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);