Relative Layout relativelayoutis a more commonly used control in the Android layout that allows you to lay out layouts for various screen resolutions,Relativelayout the control property settings relative to the location.
You can set the position of the control with the parent control, and the location between the control and the control.
1. Control and parent container location properties
Android:layout_alignparentleft= "true"child controls on left side relative to parent container
Android:layout_alignparenttop= "true"child controls top edge relative to parent container
android:layout_margintop= "50DP"distance between child control and parent container top margin
Android:layout_marginbottom= "50DP"the distance between the child control and the parent container bottom margin
android:layout_marginright= "50DP"the distance from the right margin of the child control to the parent container
android:layout_marginleft= "50DP"distance between child control and parent container left margin
Android:layout_centerinparent= "true"//child controls are centered in the parent container
android:layout_centerhorizontal= "true" //child controls are centered horizontally in the parent container
Android:layout_centervertical= "true" child controls are centered vertically in the parent container
The following example shows the layout relative to the parent container
<?xml version= "1.0" encoding= "Utf-8"? ><relativelayout xmlns:android= "http://schemas.android.com/apk/res/ Android " android:layout_width=" match_parent " android:layout_height=" match_parent "> <textview android:id= "@+id/textview1" android:layout_width= "match_parent" android:layout_height= "Match_ Parent " android:text=" is easier to layout " android:background=" #97FFFF " android:layout_alignparentleft=" true "relative to the parent" android:layout_alignparenttop= "true" android:layout_margintop= "50DP" android:layout_ Marginbottom= "50DP" android:layout_marginright= "50DP" /></relativelayout>
2. Position properties between controls and controls
3. Examples of commodity listing
. NET programmer play to Android development---(7) Relative layout relativelayout