Android five layout tags and attributes summary

Source: Internet
Author: User

1.LinearLayout


Orention Horizontal and vertical
Weight Dividing idle space
Horizontal Layout Split Width
Height of vertical layout split






The height or width specified at the time of division cannot be used Fill_parent/match_parent




2.Tablayout
<TabRow> </TabRow> One line
<TabRow> </TabRow>
The column-level relationship of the first row of the defect affects all of the following columns
3.RelativeLayout
The relationship between view
Centerinparent true
Alignparentxxxx true if the position of the father is not affixed to
Centervertical in vertical play
Centerhorzital in the horizontal drama


--------------------------------
Aboveof @view who's up there?
Who's Belowof @view under?
Toleftof @viw on whose left.
Torightof @view on whose right.
Alignxxxx @view and who is flush on the XXXX border








Homework:
1. Layout (linearlayout tablayout relativewlayout)
1. Handwritten 3 times the newly-acquired attribute explanation




TextView Text components
Text Text to display
TextSize Text Size
TextColor Text color
Background Background color


EditText Text input Box
Hint Hint text






LinearLayout Linear layout
Tablelayout Table layout
Relativelayout Relative layout


Layout_width How to view width
Layout_height How to view height
Match_parent Match Parent Component
Wrap_content Include content







Layout_weight Weight


Orientation Layout direction
Horizontal Level
Vertical Vertical


Layout_margin Around the outside margin
Layout_margintop Top margin
Layout_marginbottom Bottom margin
Layout_marginleft Left margin
Layout_marginright Right margin






Layout_padding Four-week internal margin
Paddingtop Top inner margin
Paddingbottom Bottom inner margin
Paddingleft Left inner margin
Paddingright Right inner margin






Layout_above on which view
Layout_below under which view
Layout_toleftof In which view is the left
Layout_torightof On the right of which view


Layout_aligntop Aligns with the top of a view
Layout_alignbottom Align with the bottom of a view
Layout_alignleft Align to the left of a view
Layout_alignright Align to the right of a view


Layout_alignparenttop is close to parent component
Layout_alignparentbottom is close to the parent component below
Layout_alignparentleft is close to the left of the parent component
Layout_alignparentright To the right of the parent component


Layout_centerinparent is in the center of the parent component
Layout_centerhorizontal is centered horizontally
Layout_centervertical is vertically centered






TableRow A row inside a table layout
Gravity Content Centered

Android five layout tags and attributes summary

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.