[Android] related concepts such as pix, dip, dip, and sp, androidpix

Source: Internet
Author: User

[Android] related concepts such as pix, dip, dip, and sp, androidpix

 

1. px (pixels) pixels-is a pixel, which is the actual pixel unit on the screen.

Dip or dp (device independent pixels) device independent pixels, related to the device screen.

Sp (scaled pixels-best for text size): similar to dp, it mainly deals with the font size. Dpi (dot per inch): screen pixel density. The number of pixels per inch density: density indicates the number of display points per inch (logical value). Its unit is dpi 2. dpi indicates the pixel density of the screen. That is, the number of pixels on the 1 inch. For the screen, the larger the dpi, the higher the fineness of the screen, the more clearly the screen looks. For example, the iphone 4 retina-level screen must be much higher than the iphone 3gs screen pixel density. 3. sp because it is to enlarge the pixel, mainly used for font display, according to google's suggestion, TextView font size is best to use sp for Unit 4. dp is not related to density. sp is not only related to density, but also to scale. If the screen density is 160, dp and sp are the same as px. 1dp = 1sp = 1px, but if px is used as the unit, if the screen size remains unchanged (assuming it is still 3.2), the screen density is changed to 320. The original TextView width is set to 320 PX, And the 3.2-inch screen with a density of 160 is half shorter than the 3.2-inch screen with a density. But if it is set to 160dp or 160sp. The system automatically sets the width property value to 320px. That is, 160*320/160. Among them, 320/160 can be called the density proportion factor. That is to say, if dp and sp are used, the system will automatically convert according to the screen density change. 5. dip value = (dpi value/160) * pixel value 6. pixel density and resolution are two different concepts. The resolution is the total pixel, the pixel density is the unit length pixel HVGA screen density = 160; QVGA screen density = 120; WVGA screen density = 240; WQVGA screen density = 120 VGA: Video Graphics Array, that is, display drawing matrix, equivalent to 640x480 HVGA: Half-size VGA; that is, Half of VGA, resolution 480x320; QVGA: Quarter VGA; that is, 1/4 of VGA, resolution is 320 × 240; WVGA: Wide Video Graphics Array; that is: Expanded VGA, resolution is 800 × 480 pixels; WQVGA: wide Quarter VGA; that is, expanded QVGA, with a higher resolution than QVGA and a lower resolution than VGA, generally: 400x240,480x272

Related Article

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.