Getting Started with Android. RelativeLayout Relative Layout 2

RelativeLayout relative layout 2


Snap to the control's baseline

Baseline, baseline, in order to ensure the neatness of the printed letters (written in English), the line drawn

=================

Align with the four edges of the parent control

	    android:layout_alignParentLeft="true" //Align to the left of the parent control
	    android:layout_alignParentRight="true" //Align to the right of the parent control
	    android:layout_alignParentTop="true"
	    android:layout_alignParentBottom="true"



	    <TextView  

	    android:id="@+id/textView1"
	    android:layout_width="wrap_content"
	    android:layout_height="wrap_content"
	    android:background="#FF0000"
	    android:text="align parent control"

		
	    android:layout_alignParentRight="true"
	    android:layout_alignParentBottom="true"//The above two sentences, let the textView stay in the lower right corner
	    />

=================

Align to center of parent control


	    android:layout_centerHorizontal="true"//Place the parent control. The center of the horizontal position
	    android:layout_centerVertical="true" //Place in parent control. Vertical center
	    android:layout_centerInParent="true" //Place it in the center of the parent control



Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327027660&siteId=291194637