title: What does Relative layout wrap_content do?
body: <p>I have a simple layout as follows. Even though, I set all attributes as wrap_content, the resulting layout fills the entire screen height wise. The individual layouts in themselves are small. So the top level container should only be as big as to wrap all its elements. But it seems to fill the full screen. Width wise, the same attributes work fine. 
  What am I missing here?</p>
  
  <pre><code>&lt;RelativeLayout 
      android:id="@+id/topcontainer"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:background="@drawable/solid_red"
  &gt;
  
  &lt;LinearLayout
      android:id="@+id/lowercontainer"
      android:orientation="horizontal"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:paddingBottom="10dip"
      android:layout_centerHorizontal="true"
      android:paddingLeft="0dip"
      android:paddingRight="0dip"
      android:layout_alignParentBottom="true"
      android:background="@drawable/solid_blue"
  &gt;
  
  &lt;ImageView
       android:id="@+id/lefticon"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content" 
       android:background="@drawable/ic_settings_display"
       android:layout_alignParentLeft="true"
       android:layout_alignParentBottom="true"
       android:paddingRight="0dip"
  /&gt; 
  
  &lt;ImageView
       android:id="@+id/righticon"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content" 
       android:background="@drawable/ic_settings_display"
       android:layout_alignParentRight="true"
       android:layout_alignParentBottom="true"
       android:paddingLeft="0dip"
  /&gt; 
  
  &lt;/LinearLayout&gt;
  
     &lt;TextView android:id="@+id/test"
          android:text="Test text"
          android:textStyle="bold"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" 
          android:paddingTop="10dip"
          android:gravity="center"
          android:layout_centerHorizontal="true"
          android:textSize="20dip"
          android:layout_above="@id/lowercontainer"
          android:background="@drawable/solid_green"
     /&gt;         
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/iJ9MV.png" alt="alt text"></p>