I have buttons that stick to the bottom of the layout.I want to add them to a layout and put a background to them. How can I achieve this? I tried a lot but i cant.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<in.wptrafficanalyzer.graphicspickimageviewcanvas.PaintView
android:id="@+id/paint_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/btn_pick" />
<Button
android:id="@+id/btn_pick"
android:layout_width="90dp"
android:layout_height="55dp"
android:text="pick"
android:layout_marginLeft="50dp"
android:layout_marginStart="45dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<Button
android:id="@+id/save"
android:layout_width="90dp"
android:layout_height="55dp"
android:text="save"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@+id/btn_pick"
android:layout_toEndOf="@+id/btn_pick"
android:layout_marginLeft="45dp"
android:layout_marginStart="45dp" />
</RelativeLayout>
This should do it:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<in.wptrafficanalyzer.graphicspickimageviewcanvas.PaintView
android:id="@+id/paint_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/buttonWrapper" />
<LinearLayout
android:id="@+id/buttonWrapper"
android:orientation="horizontal"
android:background="@color/yourcolor"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_alignParentBottom="true">
<Button
android:id="@+id/btn_pick"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="pick"
android:layout_marginLeft="50dp"
android:layout_marginStart="45dp" />
<Button
android:id="@+id/save"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="save"
android:layout_marginLeft="45dp"
android:layout_marginStart="45dp" />
</LinearLayout>
</RelativeLayout>
just supply something for yourcolor in colors.xml
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments