Android standard namespace, can use android officially defined standard properties. Layout_width: Android standard attribute The width of the component in the layout layout_height: Android standard attribute the width and height of the component in the layout have three constants: Match_parent: matches the parent form, which is the same size as the parent form. Wrap_content: wraps the content, which is as large as it is

View

The parent class of all Android UI components and UI layout manager. The basic properties are common to all components. Function: Draw lines, dots and circles Id: Give the component a name to make it easier to find or rely on. Background image or color padding: The distance between the component and the content layout_margin: Gravity: Specifies the distance between the rectangle’s border and the external layout. Gravity: specifies the internal alignment (up/down, left/right, center, vertical center, and horizontal center) view. LayoutParms:(layout_width,layout_height) visibility: specifies whether to display, Visible shows that invisible is hidden but occupies space gone is hidden and does not occupy space

TextView text box

Android :text: indicates the content in the text box. Android :text: indicates the font size unit. Sp Android :textColor: indicates the font color Android :maxLines: specifies the maximum number of lines (measured by line). Keep your height, and when it exceeds Max, fix it to Max line. Android :maxLength: limits the maximum length (measured by bytes).

Set picture: Can be set in the four methods (up and down or so) images drawable Top, Bottom, Left and Right drawablepadding refers to gravity: the distance between the images and text alignment, Top, Bottom, Left, Right and center

The Button Button

TextView subclass, exactly the same as TextView, but with an extra style

ImageView ImageView

SRC /drawable: Foreground images are centered by default, background images are stretched by default

AdjustViewBounds (adjustViewBounds) 2. CenterCrop (adjustcrop)

A LinearLayout

  1. Dan: Well, the horizontal is vertical from left to right.
  2. Android: Orientation Sets the orientation of the layout
  3. LinearLayout.LayoutParams(layout_marginLeft,Top,Right,Bottom,Start,

    End)
  4. Layout_gravity: alignment of components (alignment of components for linear layout)
  5. You can move up and down horizontally and you can move left and right vertically
  6. Layout_weight: weight (not by size, but by percentage)
  7. Layout_weight: width 0dp when horizontal; The height must be given a value in the vertical direction, only the height 0dp, the width must be given a value

RelativeLayout (15 special methods)

  1. Align with parent form horizontally centered, vertically centered, overall centered (Boolean value) layout_centerHorizontal layout_centerVertical layout_centerInParent 2: Align with parent form (Boolean value) layout_alignParentLeft layout_alignParentTop layout_alignParentRight layout_alignParentBottom
  2. Alignment with other components in the four directions of the other component must reference the id of the other component layout_toLeftOf layout_toRightOf layout_above layout_below

4. Alignment with the four directions of other components must reference the ID number of the other component align_Left align_Top align_Right align_Bottom TableLayout

  1. Inheriting from the LinearLayout, use percentages to adjust the width, and the height is the content of the package
  2. Each TableRow is a row
  3. Features: There is no need to implement height and width, default is wrAP_content, use weight to adjust the width.

Uncommon Layout

  1. TableLayout Each TableRow is a separate row. If the component is not written, it is also a separate row. You do not need to set the width and height
  2. FrameLayout Each component is arranged from the top left corner, stacked on top of each other, usually as a container for other components
  3. AbsoluteLayout 2.3 is out of date and doesn’t mean much, but many interview questions are old and still mention this layout (layout_x,layout_y).
  4. GridLayout 4.0 adds the same functionality as GridView, and is not as flexible as GridView, no one uses it.

Share with you

I want to work my way up

Fly forward on the blades at the highest point

Let the wind blow dry tears and sweat

I want to work my way up

Waiting for the sun to watch its face

Little days have big dreams

I have my day

Let the wind blow dry tears and sweat

One day I will have my day