First look at the picture:
Layout code:
1 <?XML version= "1.0" encoding= "Utf-8"?> 2 <LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android" 3 Android:layout_width= "Match_parent" 4 Android:layout_height= "Match_parent" 5 android:orientation= "Horizontal" > 6 <LinearLayout7 Android:layout_width= "Wrap_content" 8 Android:layout_height= "20DP" 9 Android:background= "@color/green_light" Ten Android:layout_weight= "1" One > A </LinearLayout> - - <View the Android:layout_width= "1DP" - Android:layout_height= "20DP" - Android:background= "@color/pink_light" - /> + - <LinearLayout + Android:layout_width= "Wrap_content" A Android:layout_height= "20DP" at Android:background= "@color/blue_light" - Android:layout_weight= "2" - > - </LinearLayout> - </LinearLayout>
Here, the main weight is the middle can be added to the interval
Android-linearlayout Layout Tips (ii)