title: How to make a fixed layout control area work with a FrameLayout and ImageView?
body: <p>I'm getting a little frustrated with the Layout support in ADT and Eclipse. It's Swing all over again. Basically I'm trying to implement a simple layout like so:
  RelativeLayout</p>
  
  <pre><code>+----------------+
  |                |
  | FrameLayout    |
  |    ImageView   |
  |                |
  |                |
  |                |
  +----------------+
  | LinearLayout   |
  |    TextView    |
  |    Buttons     |
  +----------------+
  </code></pre>
  
  <p>The RelativeLayout and FrameLayout are used with the ImageView for some pan/zoom listener support I wrote.</p>
  
  <p>The problem I'm having is the LinearLayout (bottom controls) won't say at the bottom of the window no matter what I try. I'll simply paste what I've got below. Note that the FieldView is an extension of an ImageView. The image displays fine, its the LinearLayout that wants to be displayed on top of the FrameLayout that's in the way.</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/fieldcontainer"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:baselineAligned="false"
      android:orientation="vertical" &gt;
  
      &lt;FrameLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent" &gt;
  
          &lt;com.test.FieldView
              android:id="@+id/field"
              android:layout_width="match_parent"
              android:layout_height="match_parent" /&gt;
  
      &lt;/FrameLayout&gt;
  
      &lt;LinearLayout
          android:id="@+id/controls"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="horizontal" &gt;
  
          &lt;Button
              android:id="@+id/buttonAddNode"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Add node" /&gt;
  
          &lt;TextView
              android:id="@+id/textViewNodeInfo"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="TextView" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Thanks in advance for any advice. Maybe I misused a RelativeLayout parameter in my previous tries.</p>
  
  <p><strong>UPDATE</strong>
  Thanks for the fast response! I couldn't comment with code below, so here's an update I've tried:</p>
  
  <pre><code>&lt;FrameLayout
      ...
      android:layout_above="@+id/controls"&gt;
  </code></pre>
  
  <p>;previously and I get the following exception at runtime: </p>
  
  <pre><code>Unable to start activity ComponentInfo{com.test.MainActivity}:
      java.lang.ClassCastException: android.widget.LinearLayout
  </code></pre>
  
  <p>The line throwing the exception is in my MainActivity.OnCreate():</p>
  
  <pre><code>view = (FieldView) findViewById(R.id.field);
  </code></pre>
  
  <p>It looks like adding layout_below caused an ID mismatch? Finding R.id.field is returning the ID for the wrong LinearLayout, which I naturally can't cast.</p>
  
  <p>Note that without the layout_above, this works without any problem, just a broken layout. Again, FieldView is just an extension of an ImageView. I store my touch listeners and some other stuff in there.</p>