title: How to avoid two linearLayout overlapping each other in Android?
body: <p>I tried to set four buttons at the bottom of the screen and make an imageView fill the rest place. However, I tried "0dp" + "weight=1" method and several other ways suggested online (can't remember the ways I have tried exactly now), but the imageView still fills the whole screen with buttons on it.</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  android:paddingBottom="@dimen/activity_vertical_margin"
  tools:context=".MainActivity"&gt;
  
  &lt;LinearLayout
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="match_parent"
      android:background="@android:color/white"&gt;
  
      &lt;ImageView
          android:id="@+id/viewImage"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          /&gt;
  
      &lt;TextView android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:id="@+id/runtime"
          android:text="Rendering......"
          android:singleLine="true"
          android:textColor="#666666"
          android:textSize="14dip"
          android:visibility="gone"/&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:id="@+id/btnsLayout"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:background="@android:color/black"&gt;
  
      &lt;Button
          android:id="@+id/btnSelectPhoto"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_weight="0.25"
          android:text="Select Photo"/&gt;
  
      &lt;Button
          android:id="@+id/btnSavePhoto"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_weight="0.25"
          android:text="Save Photo"/&gt;
  
      &lt;Button
          android:id="@+id/btnLocalFilter"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_weight="0.25"
          android:text="Local Filter"/&gt;
  
      &lt;Button
          android:id="@+id/btnCloudFilter"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_weight="0.25"
          android:text="Cloud Filter"/&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>