Search code examples
androidandroid-listviewnavigation-drawerandroid-stylesandroid-actionbar-compat

Navigation Drawer Changes background while scrolling


I am working on a Navigation Drawer using ActionBarCompact to support all the devices. It worked as expected on Android 4.4 & 4.2 devices. But when I Checked it in Android 2.3 devices it shows the drawer. But when I scroll the drawer, the Background of the drawer changes from black to white and it returns after scrolling. I don't know, why it happens.

I Used the Code in this repository:

https://github.com/gabrielemariotti/androiddev/tree/master/ActionBarCompatEclipse/

enter image description here

NOTE
It works Perfect on Android 4.4 & 4.2 devices.


Solution

  • I'm not an expert about ActionCompact, but for the ListView there's a solution for the background problem when scrolling:

    Try to add

    android:cacheColorHint="#00000000" 
    

    to the layout of the list view xml element. Does it work?