Question

I want to create a ninepatch background file (the background is a gradient image). I would like to know what are the ideal dimensions of the background image?

In addition to that, where should I put the image: drawable-ldpi, drawable-mdpi or drawable-hdpi?

Was it helpful?

Solution

Check your SDK folder inside: /platforms/android-X/data/res/drawable-hdpi You will notice there are a bunch of 9patches there. I understand that you should provide a 9patch for each type of device. So you should have a 9patch for ldpi, one for mdpi and one for hdpi. The idea is to make it as small as possible and also take into account that the 9patch doesn't go smaller than the original.

On the other hand, I don't think that a 9patch will be useful when dealing with gradient images. I would try using a GradientDrawable.

OTHER TIPS

I think its 40dip x 40dip or 60px x 60px.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top