Here is a summary of the common spatial layouts that have been used in the course of their work, as recorded here. Details are as follows:
1. Three controls, respectively, left, middle, right
Important: Use relativelayout
1<Relativelayout2Android:layout_width= "Match_parent"3android:layout_height= "Wrap_content"4android:orientation= "Horizontal" >5<TextView6Android:layout_width= "Wrap_content"7android:layout_height= "Wrap_content"8android:gravity= "Center"9Android:layout_alignparentleft= "true"/>Ten<TextView OneAndroid:layout_width= "Wrap_content" Aandroid:layout_height= "Wrap_content" -android:gravity= "Center" -Android:layout_centerhorizontal= "true"/> the<TextView -Android:layout_width= "Wrap_content" -android:layout_height= "Wrap_content" -android:gravity= "Center" +Android:layout_alignparentright= "true"/> -</RelativeLayout>
2. Two controls, respectively, in the left and right
Important: Use the layout_weight= "1" textview to open the middle and squeeze the two controls to the sides
1<LinearLayout2Android:layout_width= "Match_parent"3android:layout_height= "Wrap_content"4android:orientation= "Horizontal" >5<TextView6Android:layout_width= "Wrap_content"7android:layout_height= "Wrap_content"8android:gravity= "Center"9android:layout_gravity= "Center"/>Ten<TextView OneAndroid:layout_width= "Wrap_content" Aandroid:layout_height= "Wrap_content" -android:layout_weight= "1"/> -<TextView theAndroid:layout_width= "Wrap_content" -android:layout_height= "Wrap_content" -android:gravity= "Center" -android:layout_gravity= "Center"/> +</LinearLayout>
Keep updating ...
Android-common control layouts, left and right, and so on