Android Basics (1)

Source: Internet
Author: User

1. Basic knowledge of adaptation

Screen size screen diagonal length per inch 1 inch = 2.54 cm not very important
Screen resolution horizontal longitudinal pixel point unit px 1px = 1 pixel point resolution higher pixel better longitudinal width * Transverse width 1920 * 1080
Screen pixel density pixel dots per inch unit dpi

2.Nexus 5
Screen 4.95 inch
1920 * 1080
DPI = 445

1920^2 + 1080^2 = The pixel points on the diagonal are divided by 4.95 = 445

Base 1DP = 1px at DPI 160


Main fit 480*800 720*1280 320*480
480*854 540*960 1080*1920

3.
480 * 160dpi 320px 320DP
* 480 240dpi 480px 320DP 1DP = 1.5px
DP is the same, but PX is different


MDPI 120dpi-160dpi
HDPI 160dpi-240dpi
XHDPI 240dpi-320dpi
XXHDPI 320dpi-480dpi
Xxxhpdi 480dpi-640dpi

Learn more about http://www.apkbus.com/design Chinese design website

4.
SP Font Size
12sp
14SP Small
18SP Medium
22SP Large

5.
Weight

Calculated width = width of original width + remaining space%

0DP and Match-parent, respectively

Screen width is L

Button 1 match-parent

2/3 L = L + (l-2l) *1/3l = l-1/3l = 2/3 L

Button 2
1/3 L = l + (l-2l) *2/3l = l-2/3l = 1/3 L


Button 2 0DP

1/3 L = 0 + 1/3l = 1/3 L


6.
Pad 7 inch
Layout-large 3.2 ago
LAYOUT-SW600DP after 3.2
Land port

7. Automatic stretching. 9.png
Working with draw points in as to Extrude
Padding 0DP

Android Basics (1)

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.