Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: ListView xml layout not showing background image when scrolled

I have an Activity with a ListView, I set the background image to the view programatically. When I scroll down my list, the background image turns to white ( because my theme is Theme.Light.NoTitleBar).

  1. How can I make it scroll with the blue background intact?
  2. If the above point works, how can I change the text color of ListView to white instead of black?

Normal ListView Normal ListView

Scrolling ListView Scrolling ListView

Pressing ListView item Pressing ListView item

like image 969
Nouran H Avatar asked Feb 20 '23 00:02

Nouran H


1 Answers

  1. Use the attribute android:cacheColorHint="#000000" in ListView Tag
  2. Regarding make TextView's color black or white, you can refer here to make a custom TextView for your ListView row, The extra work you have to do is just add another attribut inside TextView tag like this

    android:textColor="#FFF" //or #FFFFFF for white

like image 76
Adil Soomro Avatar answered Apr 09 '23 18:04

Adil Soomro