Linearlayout is the simplest and most frequently used Android layout. Through simple linear layout, we can design some good interfaces. However, my design skills are average, so I can only demonstrate one failed example for you to use as a negative textbook.
We can see from the figure that the last button is not completely displayed because there is no position.
The XML Code is as follows:
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="horizontal"android:layout_width="fill_parent"android:layout_height="fill_parent"android:gravity="top"><Button android:id="@+id/bn1"android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/bn1"/><Button android:id="@+id/bn2"android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/bn2"/><Button android:id="@+id/bn3"android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/bn3"/><Button android:id="@+id/bn4"android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/bn4"/><Button android:id="@+id/bn5"android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/bn5"/></LinearLayout>