I'm currently sizing a background for an android application, I want to know, what resolutions should I supply for开发者_开发技巧 low, medium and high density screens?
I can't make a decision, as the documentation seems to refer to the density, which depends on the resolution and the physical size of the screen, while I really want an image that is scaled as little as possible to minimize resource the footprint.
Many thanks
It depends on a lot of different things. But for smaller apps I would just skip hdpi, mdpi & ldpi and put all of it in /drawable Put high res images there and phones with lower density will scale them down.
Links of interest: http://developer.android.com/guide/practices/screens_support.html
Happy coding
If you really want to choose background images based on resolution, you could combine density (-hdpi, -mdpi...) and screen size (-small, -large...) qualifiers, but it won't give you much precision, as they are not standardized, especially screen size qualifiers.
See Resource directory qualifiers for screen size and density.
You can also use four 9-patch images(for all density types) that has stretchable patches on header and footer of the image(that will just stretch the header and footer color to stretched area, this would look good in most cases) and create them based on minimum screen sizes:-
- 960dp x 720dp for xlarge screens
- 640dp x 480dp for large screens
- 470dp x 320dp for normal screens
- 426dp x 320dp for small screens
精彩评论