Android screen knowledge, DP SP PX Summary

Source: Internet
Author: User

Screen Preliminary summary.

First, the current mobile phone screen pixel density basically has 5 kinds of situations. (The following pixel density is referred to as density)

Density ldpi mdpi hdpi xhdpi xxhdpi

Density value 120 160 240 320 480

Resolution 240x320 320x480 480x800 720x1280 1080x1920

Conversion 1dp=0.75px 1dp=1px 1dp=1.5px 1dp=2px 1dp=3px

When the Android font size is "normal", the SP==DP is converted to PX and DP.

The screen widths of 1.320x480 and 480x800 are both 320dp,720x1280 and 1080x1920 screen widths are 360DP.

2. The default 360DP screen layout (more mainstream), the 320DP screen layout, layout files placed in the LAYOUT-W320DP folder, other special resolutions can be placed in the resolution of the layout files in the folder, such as layout-854x480.

3. Instead of designing the ROM, the general designer makes the picture on the 720x1280 canvas and puts the resources in the DRAWABLE-XHDPI folder when developing. A general set of materials is available. Card can provide some mdpi of the picture material.

4. You want 9.png images to have the same pixel value at different densities, i.e. not scaled, and can be placed in drawable-nodpi. The pictures in this folder are displayed according to the actual pixels.

Second, the flat

1280x800 resolution of the tablet is generally 10.1-inch medium density screen, the material is generally on the 1280x800 canvas diagram. The footage is placed in the drawable-mdpi. 1dp=1px.

Android screen knowledge, DP SP PX Summary

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.