-1

How to add a button to a DrawLayout? This code is for showing google map, and I need to add a button in the bottom of the map.

<android.support.v4.widget.DrawerLayout   xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:tools="http://schemas.android.com/tools"
            android:id="@+id/drawer_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:context=".MainActivity" >


      <FrameLayout
            android:id="@+id/container"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />


            <fragment
                android:id="@+id/navigation_drawer"
                android:name="com.lia.sonorMap.NavigationDrawerFragment"
                android:layout_width="@dimen/navigation_drawer_width"
                android:layout_height="match_parent"
                android:layout_gravity="start"
                tools:layout="@layout/fragment_navigation_drawer" />

<Button
        android:id="@id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button" 
        android:layout_alignParentBottom="true"/>
        </android.support.v4.widget.DrawerLayout>

Thanks

Nathan Hughes
  • 94,330
  • 19
  • 181
  • 276
user3020848
  • 101
  • 1
  • 1
  • 2

1 Answers1

0

you can add button inside relative layout

  <android.support.v4.widget.DrawerLayout   xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >


<FrameLayout
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />


<fragment
    android:id="@+id/navigation_drawer"
    android:name="com.lia.sonorMap.NavigationDrawerFragment"
    android:layout_width="@dimen/navigation_drawer_width"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    tools:layout="@layout/fragment_navigation_drawer" />
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@color/Azure">

<Button
    android:id="@id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button"
    android:layout_alignParentBottom="true"/>
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
Amit Basliyal
  • 840
  • 1
  • 10
  • 28