"Android" about PIX,DIP,DIP,SP and other related concepts

Source: Internet
Author: User

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

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

SP (scaled pixels-best for text size): Similar to DP, mainly handles font size.  DPI (dot per inch): screen pixel density, how many pixels per inch  density:density represents the number of display points per inch (logical value), and its unit is dpi 2.dpi is the screen pixel density. is the number of pixels on the 1-inch point. For the screen, the larger the DPI, the higher the fineness of the screen, the more clearly the screen will look. For example, iphone4 's retina-level screen is certainly much higher than the screen pixel density of the iphone 3GS.  3.SP because it is to enlarge the pixel, mainly for the font display, according to Google's suggestion, TextView's font size is best used SP do unit  4.DP is not related to density, SP in addition to density-independent, but also independent of scale. If the screen density is 160, then the DP and SP and PX are the same. 1DP=1SP=1PX, but if you use PX as the unit, if the screen size is constant (assuming 3.2 inches), the screen density becomes 320. So the original width of the TextView is set to 160px, in the density of 320 of the 3.2-inch screen is more than the density of 160 of the 3.2-inch screen to see the half-short. But if it is set to 160DP or 160SP. The Width property value is automatically set to 320px. That means 160 * 320/160. 320/160 of these are called density scale factors. That is, if you use the DP and SP, the system will automatically convert based on the change in screen density.   5.dip value = (dpi value/160) * pixel value  6. Pixel density and resolution are two different concepts, the resolution is the total pixel, pixel density is the unit length of pixels  HVGA screen density= 160;QVGA Screen DENSITY=120;WVGA screen DENSITY=240;WQVGA screen Density=120 vga:video Graphics array, that is: Display the drawing matrix, equivalent to 640x480   hvga:half-size VGA, that is, half of the VGA, the resolution is 480x320; qvga:quarter VGA, that is: VGA One-fourth, the resolution is 320x240; wvga:wide Video Graphics Array, i.e.: enlarged VGA with resolution of 800x480 pixels;  wqvga:wide QuarterVGA; that is: enlarged QVGA, higher resolution than QVGA, lower than VGA, generally: 400x240,480x272

"Android" for related concepts such as PIX,DIP,DIP,SP

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.