In the reslayout folder, layout files in xml format are mainly stored in LinearLayout (linear layout), TableLayout (table layout), RelativeLayout (relative layout), and AbsoluteLayout (absolute layout) frameLayout (frame layout) and so on can also achieve better interface effects through nesting. I sorted out common attributes according to my personal understanding, which may be unscientific, but I think it is very practical. XML layout file
Xml layout files are stored in the res/layout folder.
The layout methods include LinearLayout (linear layout), TableLayout (table layout), and RelativeLayout (relative layout)
Of course, there are also AbsoluteLayout, (absolute layout), FrameLayout (frame layout), and so on.
They can also achieve better interface effects through nesting.
I sorted out common attributes according to my personal understanding.
It may be unscientific, but I think it is very practical.
Controls are as follows:
Android: id address
Android: width
Android: height
Android: layout_width (fill_parent/wrap_content)
Android: layout_height (fill_parent/wrap_content)
Android: layout_margin (Left/Top/Right/Bottom) margin (* dip)
Android: layout_weight weight
Control content:
Android: text content
Android: textSize text size
Android: basic location of gravity content
Android: background color (RBG)
Android: padding (Left/Top/Right/Bottom) padding (* dip)
Android: singleLine peer display (true/false)
Relative layout:
Android: alignment (id) of the lower part of layout_above)
Android: layout_below align with the following (id)
Android: layout_toLeftOf alignment to the left of the person (id)
Android: layout_toRightOf align with the right of the person on the left (id)
Android: layout_alignTop aligntop)
Android: layout_alignBottom, whose bottom is aligned (id)
Android: layout_alignLeft alignleft)
Android: layout_alignRight align with the right of the person (id)
Android: layout_alignParentTop alignparenttop aligned with the parent control (true/false)
Android: layout_alignParentBottom: alignparentbottom is aligned with the parent control (true/false)
Android: layout_alignParentLeft alignparentleft (true/false)
Android: layout_alignParentRight: alignparentright (true/false)
Android: layout_centerInParent Center relative to parent control (true/false)
Android: layout_centerHorizontal align horizontally with the parent control (true/false)
Android: layout_centerVertical center vertically relative to the parent control (true/false)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The registration page I just completed is shown below
The above is the detailed content shared by the code case of the XML layout file. For more information, see other related articles in the first PHP community!