1
votes

When the 9 patch files scale for different densities, What is the use of images under the differnt folders in Eclipse.

drawable-ldpi drawable-mdpi drawable-hdpi drawable-xhdpi

Why cant we use the single .9.PNG file instead of having different PNG files for different Densities?

1
You can use a single 9patch, but scaling from small to large doesn't always look good enough. Also, 9patch isn't used strictly for scaling, it's used to scale must of the image while leaving some portion of the border intact.mah

1 Answers

0
votes

There are a lot of images that you can't scale with 9 patches because they have not content area. The app icon for example, you don't want it to only have a few pixels on xxhdpi screens in the middle and scale the rest.

You should only use 9 patches when you have border areas that should be stretched out, but that's not the case for most graphics you will use. Examples are borders that are too hard to define in XML, really complex corners etc.