"Android Beginner" 3, Control layout preliminary

Source: Internet
Author: User

What is control layoutThe so-called control layout method refers to the method that controls the position, size, color, and other control style properties of the control within the activity. control layout, in Android, there are two methods:1. Use layout file to complete control layout (relatively simple) 2, complete control layout in Java code (dynamic layout, more flexible, and relatively complex) Layout Method Classification1.Linear Layout(easiest to master) Linear layout: can be arranged vertically or horizontally. 2.ralative Layout(most commonly used, familiar with web development is familiar) 3,ListView4.Grid View length units and internal and external margins Length UnitsPS: Pixel pxDPI: Number of dots per inch (dpi = radical (height^2 + width^2) ÷size) (size in inches)DP: DP = Dip (device independent pixels) equipment-independent pixels, often used to set the size of the control. Conversion formula PX = DP * (dpi/160) on screen with dpi (pixels per inch) of 160:1DP = 1pxSP: scaled pixels SP units are typically used to specify the size of the font when the user modifies the system font size, the font size changes. internal and external margins"===================================end================================="

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.