put buttons in relative layout

rowwwss

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>
kandroidj

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Is it possible to put some Buttons in a Linear or Relative Layout in variable rows?

From Dev

Unable to put 3 buttons and 1 edit text inside a relative layout

From Dev

5 buttons in one line, relative layout

From Dev

Dynamically List Buttons in Android Studio (Relative Layout)

From Dev

To align all buttons equally in relative layout

From Dev

Relative layout rendering incorrect (buttons are messed up)

From Dev

How to put Divider in Relative Layout Android?

From Dev

Android - Put object each others on Relative Layout

From Dev

Add Buttons to Relative Layout Dynamically or Extended Linear Layout android

From Dev

Add Buttons to Relative Layout Dynamically or Extended Linear Layout android

From Dev

How to make 2 horizontal buttons to fill relative layout equally?

From Dev

How to set multiple buttons in Relative Layout in multiple lines

From Dev

Need help on creating 4 relative layouts inside a grid layout (2x2) and put one button in the center of each relative layout

From Dev

Linear Layout Or Relative Layout?

From Dev

Android how to open same activity with different relative layout views when onclick buttons?

From Dev

Relative layout placing to other relative layout

From Dev

Zooming a layout (Relative Layout) in android

From Dev

Coordinator Layout and Relative Layout issue

From Dev

Convert a Relative Layout to a Linear Layout

From Dev

Relative layout - layout_toRightOf

From Dev

Layout issue related to "Relative Layout"

From Dev

Zooming a layout (Relative Layout) in android

From Dev

Missing items in a Relative Layout

From Dev

Keeping relative layout fixed

From Dev

Putting TextViews in relative layout

From Dev

android relative layout design

From Dev

Infalting Relative Layout Android

From Dev

Relative layout and navigation drawer?

From Dev

Swipable Linear/Relative Layout

Related Related

  1. 1

    Is it possible to put some Buttons in a Linear or Relative Layout in variable rows?

  2. 2

    Unable to put 3 buttons and 1 edit text inside a relative layout

  3. 3

    5 buttons in one line, relative layout

  4. 4

    Dynamically List Buttons in Android Studio (Relative Layout)

  5. 5

    To align all buttons equally in relative layout

  6. 6

    Relative layout rendering incorrect (buttons are messed up)

  7. 7

    How to put Divider in Relative Layout Android?

  8. 8

    Android - Put object each others on Relative Layout

  9. 9

    Add Buttons to Relative Layout Dynamically or Extended Linear Layout android

  10. 10

    Add Buttons to Relative Layout Dynamically or Extended Linear Layout android

  11. 11

    How to make 2 horizontal buttons to fill relative layout equally?

  12. 12

    How to set multiple buttons in Relative Layout in multiple lines

  13. 13

    Need help on creating 4 relative layouts inside a grid layout (2x2) and put one button in the center of each relative layout

  14. 14

    Linear Layout Or Relative Layout?

  15. 15

    Android how to open same activity with different relative layout views when onclick buttons?

  16. 16

    Relative layout placing to other relative layout

  17. 17

    Zooming a layout (Relative Layout) in android

  18. 18

    Coordinator Layout and Relative Layout issue

  19. 19

    Convert a Relative Layout to a Linear Layout

  20. 20

    Relative layout - layout_toRightOf

  21. 21

    Layout issue related to "Relative Layout"

  22. 22

    Zooming a layout (Relative Layout) in android

  23. 23

    Missing items in a Relative Layout

  24. 24

    Keeping relative layout fixed

  25. 25

    Putting TextViews in relative layout

  26. 26

    android relative layout design

  27. 27

    Infalting Relative Layout Android

  28. 28

    Relative layout and navigation drawer?

  29. 29

    Swipable Linear/Relative Layout

HotTag

Archive