Relative Layout You can specify a positional relationship between elements of a sibling (e.g. Layout_toleftof) You can also specify a positional relationship between child elements and parent elements (e.g. Layout_alignparentleft left-justified relative to the parent element) This makes it easy to align the picture at the bottom of the screen.
The code is as follows:
<?xml version= "1.0" encoding= "Utf-8"?>
<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:orientation= "Vertical"
android:divider= "@drawable/line"
android:showdividers= "Middle" >
<!--news Content--
<webview
Android:id= "@+id/web"
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
android:layout_weight= "1" >
</WebView>
<!--bottom picture--
<relativelayout
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
Android:layout_margin= "10DP"
>
<imagebutton
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_gravity= "Center_horizontal"
android:layout_marginleft= "10DP"
Android:layout_alignparentleft= "true" <! --left-justified in parent element
android:background= "@drawable/back"/>
<imagebutton
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:layout_gravity= "Center_horizontal"
Android:layout_centerinparent= "true" <! --center-align in parent element
android:background= "@drawable/house"/>
<imagebutton
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
android:background= "@drawable/share"
Android:layout_alignparentright= "true" <! --right-justified in the parent element
android:layout_marginright= "10DP"
Android:layout_gravity= "Center_horizontal"
/>
</RelativeLayout>
</LinearLayout>
Android-How to align at bottom left, align, right three buttons picture skillfully with relative Layout