Relative layout is the use of relative positional relationships between controls to set the layout.
A control in a container has a relative relationship to any other control or container.
For example:
<?xml version= "1.0" encoding= "Utf-8"? ><relativelayout xmlns:android= "http://schemas.android.com/apk/res/ Android "Android:layout_width=" Fill_parent "android:layout_height=" Fill_parent "> <textview android: Id= "@+id/textview2" android:layout_width= "wrap_content" android:layout_height= "Wrap_content" Android: layout_alignright= "@+id/textview1" android:layout_below= "@+id/textview1" android:layout_margintop= "14DP" Android:text= "Dear ~"/> <textview android:id= "@+id/textview1" android:layout_width= "wrap_content "Android:layout_height=" Wrap_content "android:layout_alignparenttop=" true "Android:layout_centerhori Zontal= "true" android:layout_margintop= "26DP" android:text= "Happy Mid-Autumn Festival"/> <analogclock android:id = "@+id/analogclock1" android:layout_width= "wrap_content" android:layout_height= "Wrap_content" Android : layout_below= "@+id/textview2" Android:layout_centerhorizontal= "true" android:layout_margintop= "14DP"/></relativelayout>
Layout Completion Effect:
The main way to use relative layout is to set the relative position of a control with the controls around him: for example, it is flush with the bottom of the * *, is flush with the top of a control, and is relative to the position in the parent control on the left or right side of a control.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android--layout:relativelayout