Matthieu Lemonnier
Matthieu Lemonnier

Reputation: 122

Background not displayed for the Navigation drawer

I have implemented a navigation drawer, thanks to the sample available with the sdk.

I changed the navigation drawer background to an image of mine. It works well on my phone (Samsung Ace 3 Android 4.2.2), on a nexus 4 with lollipop. But on a friend's phone (HTC Sense, with lollipop) the navigation drawer has no background.

You can see that : enter image description here

And here is what is expected:

enter image description here

The background is set in the layout xml file, as follows :

<ListView xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:background="@drawable/navigation_drawer_background"
   android:choiceMode="singleChoice"
   android:divider="@null"
   android:dividerHeight="0dp"
   tools:context="cartel.mines.nantes2015.NavigationDrawerFragment" />

It seems to be a problem of overlay. Overlays are very annoying!

Upvotes: 0

Views: 285

Answers (1)

Pramod Yadav
Pramod Yadav

Reputation: 2326

you are missing your background drawable file from different drawable folders according to screen density.Create images with proper resolution which you want for the different screen resolutions and place it into respective folder(mdpi,hdpi,xhdpi or xxhdpi).

Upvotes: 2

Related Questions