开发者

Dealing with drawables for various screens sizes

I have observed from the HDPI, MDPI and LDPI icons from a new Android project, they are in the ratio of 6:4:3 (72:48:36). So would it be a good idea to scale my other drawables in the same ratio? If not what is the best way to scale drawable resources for an application for deploymen开发者_如何学Got?


HDPI represents a device with 240DPI, MDPI represents a device with 160DPI, and LDPI represents a device with 120DPI. The ratios are hence 1.5:1:0.75 (same as what you have figured out).

If you don't provide appropriate drawables, Android will attempt to scale them up in the same ratio anyway.

If the device's screen density is not medium, the application's layout and drawing of its content is as if the screen is medium density, but the framework scales the layout and images (if the image for the target density is not available) to fit the target density. It scales 1.5 times if the target density is high density (160->240 virtual dpi), or 0.75 times if the target density is low density (160 -> 120 virtual dpi).

Taken from the guidelines: http://developer.android.com/guide/practices/screens_support.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜