0
votes

I have layout files for small, medium , large screens. But I notice that my project does not show the right drawables. For instance:- I have an xml file called main.xml which should display an image on the app.

my res folder is structured drawable drawable-hdpi drawable-ldpi drawable-mdpi drawable-xhdpi drawable-xxhdpi

layout main.xml --- image here shows drawable in drawable-mdpi

layout-large main.xml ---- image here show drawable in drawable-mdpi instead of drawable-hdpi

image in drawable-hdpi is much bigger so I expect it to show in layout-large (main.xml) but it not instead it showing the one in mdpi.

Is it resolution of the image cos they bear the same name. If it is the resolution that is the problem please wat are the image resolution of all the dpi drawables. I have read many post but I cant answer my question.

ldpi Resources for low-density (ldpi) screens (~120dpi). mdpi Resources for medium-density (mdpi) screens (~160dpi). (This is the baseline density.) hdpi Resources for high-density (hdpi) screens (~240dpi). xhdpi Resources for extra high-density (xhdpi) screens (~320dpi).

I got does resources above from the android developer site. Please this 120dpi does it mean resolution for the images. I dont get it.

1

1 Answers

0
votes

make sure you are calling those images using "dp" instead of "px". See this for reference http://developer.android.com/guide/topics/resources/more-resources.html#Dimension