The UI of Android learning experience

Source: Internet
Author: User

Layout Linearlayout:linearlayout is a linear layout that can be set by setting the Orientaltion property to a linear layout in the vertical direction or a linear layout in the horizontal direction. Vertical Linear layout: android:orientation= "vertical" horizontal line layout: android:orientation= "Horizontal" It is important to note that internal controls cannot set the width to match if the layout is horizontal. _parent, because then there will be a control that fills the entire horizontal direction, with no other controls in place. The relativelayout:relativelayout is relative to the layout, and the relative layout is set by setting the way:
  
 
  1. <!--相对于父布局-->
  2. <android:layout_alignParentLeft="true"
  3. android:layout_alignParentTop="true"
  4. android:layout_centerInParent="true"
  5. android:layout_alignParentButton="true"
  6. >
  7. <!--相对于控件-->
  8. <android:layout_above="@id/button3"
  9. android:layout_toLeftOf="@id/button3"
  10. android:layout_toRightOf="@id/button3"
  11. android:layout_below="@id/button3"
  12. >
Tablelayout:tablelayout is the table layout.
  
 
  1. <TableRow>
  2. <!--第一行第一列-->
  3. <TextView />
  4. <!--第一行第二列-->
  5. <TextView />
  6. </TableRow>
  7. <TableRow>
  8. <!--第二行第一列-->
  9. <TextView />
  10. <!--第二行第二列-->
  11. <TextView />
  12. </TableRow>
When a row has only one column, you can merge cells by android:layout_span= "2" by android:stretchcolumns= "" To set the column stretch to fill the screen blank, set to 1 to extrude the first column, Set to 0 to extrude the second column units and dimensions px to pixels, for the picture pt is the number of points, for the text but PX and PT have obvious flaws, on different resolutions of the screen, the same pixel and the number of points displayed on the screen will not be the same size. DP is a density-independent pixel for consistent display of different screens, more for picture SP as scalable pixel, for solving text size adaptation issues




From for notes (Wiz)

The UI of Android learning experience

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.