Android Studio: Button does not show up under the listview in a linear layout
<p>I want to have the delete button under the listview, and I tried writing it in both linear layout and relative layout, but the delete button just doesn't show up in both layout. What could be the problem?</p>

<p>In RelativeLayout version</p>

<pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="myproject.testing.listviewwithbutton"&gt;

&lt;LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"&gt;

    &lt;RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"&gt;

        &lt;AutoCompleteTextView
            android:id="@+id/autoCompleteTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:hint="New Ingredient"
            android:layout_alignParentTop="true" /&gt;

        &lt;Button
            android:id="@+id/addButton"
            android:layout_width="wrap_content"
            android:layout_height="41dp"
            android:text="Add"
            android:layout_alignBaseline="@id/autoCompleteTextView"
            android:layout_alignParentRight="true"/&gt;

    &lt;/RelativeLayout&gt;

    &lt;ListView
        android:layout_width="wrap_content"
        android:layout_height="457dp"
        android:id="@+id/mainListView"
        android:layout_weight="1"/&gt;

    &lt;RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="bottom"&gt;

        &lt;Button
            android:id="@+id/deleteButton"
            android:layout_width="wrap_content"
            android:layout_height="41dp"
            android:text="Delete"

            android:layout_gravity="center_horizontal"
            android:layout_weight="0"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true" /&gt;

&lt;/RelativeLayout&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p></p>

<p>In LinearLayout version
    </p>

<pre><code>&lt;LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"&gt;


    &lt;RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"&gt;

        &lt;AutoCompleteTextView
            android:id="@+id/autoCompleteTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:hint="New Ingredient"
            android:layout_alignParentTop="true" /&gt;

        &lt;Button
            android:id="@+id/addButton"
            android:layout_width="wrap_content"
            android:layout_height="41dp"
            android:text="Add"
            android:layout_alignBaseline="@id/autoCompleteTextView"
            android:layout_alignParentRight="true"/&gt;

    &lt;/RelativeLayout&gt;



    &lt;ListView
        android:layout_width="wrap_content"
        android:layout_height="457dp"
        android:id="@+id/mainListView"
        android:layout_weight="1"/&gt;

    &lt;Button
        android:layout_width="wrap_content"
        android:layout_height="41dp"
        android:id="@+id/deleteButton"
        android:text="Delete"
        android:layout_weight="0"
        android:layout_gravity="center_horizontal"/&gt; 

&lt;/LinearLayout&gt;
</code></pre>

<p></p>