Android Interface Layout

Source: Internet
Author: User
<span id="Label3"></p><p><p>Android layout is the beginning of all Android apps with an interface, and the layout app directly determines the user Experience.</p></p><p><p><br></p></p><p><p>There are five layouts for android, framelayout (stack layout), linearlayout (linear layout), relativelayout (relative layout), tablelayout (table layout), Absolutelayout (absolute layout). The most commonly used layouts are framelayout, linearlayout, and Relativelayout.</p></p><p><p><br></p></p><p><p>Framelayout: use <FrameLayout> label in Layout file. The view in the Framelayout layout is displayed in a cascading fashion, similar to Photoshop's layers. The last view is displayed at the top, so you can call framelayout a stack Layout.</p></p><p><p>Linearlayout: multiple view can be arranged horizontally or vertically. If the value of the Android:orientation property is horizontal,view, The property value Vertical,view is arranged vertically. Horizontal is the default value for the Android:orientation Property.</p></p><p><p>Relativelayout: You can place components by identifying the relative positions of two or more components. Relative position related to component hungry properties include Android:layout_toleftof (placing the current component to the left of the specified component of the property), Android:layout_torightof (placing the current component to the right of the specified component of the property), android: Layout_below (places The current component below the specified component of the property), Android:layout_above (places the current component above the specified component of the property). These 4 attribute values must specify an ID that already exists.</p></p><p><p>Tablelayout layouts can arrange the view in tabular form.</p></p><p><p>Absolutelayout can set the absolute coordinates of the view, but it is not recommended to use the Absolutelayout design interface because the layout does not adapt to changes in screen Resolution.</p></p><p><p><br></p></p><p><p>Common layout properties:</p></p><p><p>Android:id: the control specifies the appropriate ID.</p></p><p><p>Android:text: displays text in the control, using Strings.xml as much as Possible.</p></p><p><p>Android:gravity: the basic position of the text in the control, such as center, left, right, center_horizontal, and so On.</p></p><p><p>Android:textsize: the font size in the control, in Pt.</p></p><p><p>Android:background: Control Background Color.</p></p><p><p>Android:width: the width of the Control.</p></p><p><p>Android:height: the height of the Control.</p></p><p><p>Android:padding: the padding within the Control.</p></p><p><p>Android:siglelise: true, the contents of the control are displayed on the same line.</p></p><p><p>Android:margin: Margin.</p></p><p><p><br></p></p><p><p>Android:layout_centerhrizontal whether the horizontal direction of the central</p></p><p><p>Android:layout_centervertical whether the vertical direction of the central</p></p><p><p>Android:layout_centerinparent As for the parent control horizontal/vertical Direction Center</p></p><p><p>Android:layout_alignparentbottom is aligned with the bottom of the parent control</p></p><p><p>Android:layout_alignparentleft is aligned to the left of the parent control</p></p><p><p>Android:layout_alignparentright is aligned to the right of the parent control</p></p><p><p>Android:layout_alignparenttop is aligned to the top of the parent control</p></p><p><p>Android:layout_alignwithparentifmissing</p></p><p><p><br></p></p><p><p>Android:layout_below on the top of XXX</p></p><p><p>Android:layout_above under XXX</p></p><p><p>Android:layout_toleftof the left edge of the control to the right of the given control</p></p><p><p>Android:layout_torightof the right edge of the control to the left of the given control</p></p><p><p>Android:layout_aligntop aligns the top of the control with the top of a given control</p></p><p><p><br></p></p><p><p>The distance between the Android:layout_marginbottom and the bottom</p></p><p><p>The distance between the Android:layout_marginleft and the left</p></p><p><p>The distance between the android:layout_marginright and the right</p></p><p><p>The distance between the Android:layout_margintop and the top</p></p><p><p><br></p></p><p><p>This article is from the "small ant" blog, please make sure to keep this source http://16410743.blog.51cto.com/10657793/1691315</p></p><p><p>Android Interface Layout</p></p></span>

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.