How Android makes controls at the bottom of the interfaceThere are a number of ways to make the control at the bottom of the interface, and here's what I'll say:First, the LinearLayout layout:With three principles you can easily make the control at the bottom of the interface:1. Outermost parent container linearlayout set height layout_height= "match_parent" 2, the inner layer linearlayout set layout_weight= "1" and layout_height= "0DP" 3, the inner layer linearlayout settings where the control position:android:gravity= "Center|bottom" The following is a practical example to verify (for example). The layout file code is as follows: <linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"xmlns:tools= "Http://schemas.android.com/tools"android:layout_width= "Fill_parent"android:layout_height= "Match_parent"android:paddingleft= "@dimen/activity_horizontal_margin"android:orientation= "Vertical"tools:context= ". Mainactivity ">
<textviewandroid:text= "@string/hello_world"android:layout_weight= "0"android:layout_width= "Wrap_content"android:layout_height= "Wrap_content"/>
<linearlayoutandroid:layout_width= "Fill_parent"android:layout_height= "0DP"android:orientation= "Horizontal"android:gravity= "Bottom|center"android:layout_weight= "1" ><edittextandroid:minwidth= "280DP"android:layout_width= "Wrap_content"android:layout_height= "Wrap_content"android:text= "Please enter content"/><buttonandroid:layout_width= "Wrap_content"android:layout_height= "Wrap_content"android:text= "Send"/></LinearLayout></LinearLayout>Note: When using the LinearLayout layout, don't forget to set the ordering of the controls Oh android:orientation This property does not set an error .Second, the Relativelayout layoutThis layout is more flexible and easy to set up, just to add in the control
This property allows the control to be positioned below the screen.
Android makes the control at the bottom of the interface