Relative layout of Android App

1、 What is relative layout? Relative layout is another way to place controls. Relative layout is achieved by specifying the relative position between the current control and its sibling or parent control

2、 Why should relative layout be used? UI performance is better than linear layout

3、 The two sets of common property values of relative layout are the ID of an existing control:

(1)android:layout_ Below is placed on the lower edge of an existing ID control (that is, the upper edge of the current control is aligned to the lower edge of an ID control

(2)android:layout_ Above is placed on the upper edge of an existing ID control (that is, the lower edge of the current control is aligned to the upper edge of an ID control

(3)android:layout_ Toleftof is placed on the left of an existing ID control (that is, the right of the current control is aligned to the left of an ID control

(4)android:layout_ Torightof is placed on the right side of an existing ID control (that is, the left side of the current control is aligned to the right side of an ID control)

(5)android:layout_ Alignleft aligns the left edge of the current control to the left edge of an existing ID control

(6)android:layout_ Alignright aligns the right edge of the current control to the right edge of an existing ID control

(7)android:layout_ Aligntop aligns the top edge of the current control to the top edge of an existing ID control

(8) Android: alignbottom aligns the lower edge of the current control to the lower edge of an existing ID control

1. Align to the reference line of the control. The reference line is the line delimited to ensure the tidiness of printed letters. The value is the ID: Android: layout of a control_ alignBaseline

2. The alignment value with the four edges of the parent control is true or false: (1) Android: Layout_ Align alignparentleft to the left of the parent control (2) Android: Layout_ Align parentright align the money to the right of the parent control (3) Android: Layout_ Align parenttop to the top of the parent control (4) Android: Layout_ Alignparentbottom aligns to the lower edge of the parent control

3. Align to the central position of the parent control. The value is true or false: (1) Android: Layout_ Align centerinparent to the most central position of the parent control (2) Android: Layout_ layout_ Align horizontal to the horizontal center of the parent control (3) Android: Layout_ Centervertical aligns to the vertical center of the parent control

4. The new attribute value of Android 4.2 relativelayout layout is Di of an existing control: (1) Android: Layout_ Alignstart align the starting position of the current control to the starting position of a control ID (2) Android: Layout_ Alignend aligns the start position pair of the current control to the end position of an existing control ID

The value is true or false: (1) Android: Layout_ Align parentstart to the starting position of the parent control (2) Android: Layout_ Alignparentend aligns to the end of the parent control

5. Centered font

4、 Relative layout instance - login interface

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>