[Android share] thoroughly understand ldpi, MDPI, hdpi, xhdpi, xxhdpi

Source: Internet
Author: User

From: http://www.eoeandroid.com/thread-565562-1-1.html?_dsign=42bed080

Thank you very much for sharing

This question I believe that a lot of people, including many old birds, and some people think they understand is actually wrong, including before I, generally let the artist do 720*1280 transduction, directly put to xhdpi under, if is done 1080*1920, directly put to xxhdpi under. In fact, these four folders and the specific screen resolution is not directly related, the above-mentioned practice also has some reason, because most of the 720*1280 mobile phones are high-density mobile phones, 1080*1920 are ultra-high-density mobile phones, but these four folders and screen density, and specific resolution independent.

Here is the most critical equation:
Low:medium:high:extra-high:extra-extra-high=3:4:6:8:12

OK, which means that the ratio of five folders is 3:4:6:8:12. What exactly is going on? The following analysis:
For example, I use a 480*800 4-inch mobile phone, the cell phone's screen density according to Google's view, is the level of density (by the resolution and screen size to calculate the density, Then Google itself has a set of criteria that you are located in which level of density levels, and then the application of this phone in the picture, will go to hdpi down to find,and with the picture of this folder as standard, that is to say, for example, my application to take a picture of aa.png, the image of the original size of 30*30, just hdpi next to a picture, then this picture shows on the screen, its display size is 30px long and wide. That's the problem, but if my hdpi without this picture, and only under xhdpi have this picture, the original size of the picture is 30*30, then ask the screen to show the size of the picture will be how much, or the length of the width is 30px?


The answer is no, and now it's using the proportions above,High:extra-high=6:8. First clear such a problem, if my screen is hdpi, the result of my picture is put in xhdpi, the system will be the picture to reduce the display, that is, my xhdpi decentralized a 30*30 picture, that shows when the hdpi screen is certainly smaller than 30*30, This will ensure that the size of the screen interface display is consistent, because the density of the mobile phone display a picture is larger than the density of the mobile phone display the same image of the area to be large, to show the same area you have to make the picture smaller. Answer the question above,

Assuming that the width of the picture displayed on my hdpi screen is x, that satisfies the following equation:
6:8=x:30.
Can get x=22.3, take the whole number back to 23.

[Android share] thoroughly understand ldpi, MDPI, hdpi, xhdpi, xxhdpi

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.