Relativelayout not wrapping its content
<p>I want my inner <code>RelativeLayout</code> to wrap it's content and stay below the <code>View</code> element. Why isn't it behaving like the pic below?</p>

<p><strong>My layout.xml</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;
    &lt;View
        android:id="@+id/linearLayout"
        android:layout_above="@+id/input_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/&gt;

    &lt;RelativeLayout
        android:id="@+id/input_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="#ebebeb"&gt;

        &lt;EditText
            android:id="@+id/editText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_toLeftOf="@+id/imageView13"
            android:layout_toStartOf="@+id/imageView13"
            android:background="@android:color/white"
            android:padding="8dp" /&gt;

        &lt;ImageView
            android:id="@+id/imageView13"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:src="@drawable/ic_m_send" /&gt;

    &lt;/RelativeLayout&gt;

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

<p><a href="https://i.stack.imgur.com/BYZSw.png" rel="noreferrer"><img src="https://i.stack.imgur.com/BYZSw.png" alt="enter image description here"></a></p>