title: Android view layout component on top of each other
body: <p>I was having some problem with the layout of Android Activity. So basically I have a navigation drawer and two Activity. The layout was working perfectly when I wrap all of them with a frame layout. However, because of the navigation drawer issues, I have to remove the frame layout into another xml layout. And then from there, my layouts were all messed up. Here is my layout.xml:</p>
  
  <pre><code>&lt;LinearLayout 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:orientation="vertical"&gt;
  
      &lt;com.esri.android.map.MapView
          android:id="@+id/map"
          android:layout_width="fill_parent"
          android:layout_height="100dp"
          initExtent="21801.3, 25801.0, 33218.7, 44830.0" &gt;
      &lt;/com.esri.android.map.MapView&gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="100dp"
          android:layout_marginLeft="45dp" &gt;
  
          &lt;ImageView
              android:id="@+id/ivEventGuide"
              android:layout_width="230dp"
              android:layout_height="100dp"
              android:layout_gravity="center"
              android:src="@drawable/event_create_guide"
              android:visibility="gone" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;RelativeLayout
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" &gt;
  
          &lt;Button
              android:id="@+id/btnNewsFeed"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:background="@color/lightred"
              android:minHeight="20dp"
              android:paddingBottom="5dp"
              android:text="News feed"
              android:textColor="#FFFFFF"
              android:textSize="13dp" /&gt;
  
          &lt;LinearLayout
              android:id="@+id/llNewsFeed"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:layout_below="@+id/btnNewsFeed"
              android:background="#FFFFFF"
              android:orientation="vertical"
              android:visibility="gone" &gt;
  
              &lt;ListView
                  android:id="@+id/EventNewsFeedListview"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:listSelector="#F6CECE" &gt;
              &lt;/ListView&gt;
          &lt;/LinearLayout&gt;
  
          &lt;Button
              android:id="@+id/btnLegends"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_below="@+id/btnNewsFeed"
              android:background="#FFFFFF"
              android:minHeight="20dp"
              android:paddingBottom="5dp"
              android:text="Legends"
              android:textColor="@color/lightred"
              android:textSize="13dp" /&gt;
  
          &lt;LinearLayout
              android:id="@+id/legendDiv"
              android:layout_width="match_parent"
              android:layout_height="100dp"
              android:layout_below="@+id/btnLegends"
              android:background="#fff"
              android:orientation="vertical"
              android:visibility="gone" &gt;
  
              &lt;TableLayout
                  android:id="@+id/tableEvent"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:stretchColumns="1" &gt;
  
                  &lt;TableRow
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:paddingTop="4dp" &gt;
  
                      &lt;ImageView
                          android:layout_width="0dp"
                          android:layout_height="30dp"
                          android:layout_gravity="right"
                          android:layout_weight="1"
                          android:adjustViewBounds="true"
                          android:src="@drawable/food" /&gt;
  
                      &lt;TextView
                          android:layout_width="0dp"
                          android:layout_height="wrap_content"
                          android:layout_weight="1"
                          android:gravity="left"
                          android:paddingTop="10dp"
                          android:text="Food Event"
                          android:textColor="#000"
                          android:textSize="10dp" /&gt;
  
                      &lt;ImageView
                          android:layout_width="0dp"
                          android:layout_height="30dp"
                          android:layout_gravity="right"
                          android:layout_weight="1"
                          android:adjustViewBounds="true"
                          android:src="@drawable/sport" /&gt;
  
                      &lt;TextView
                          android:layout_width="0dp"
                          android:layout_height="wrap_content"
                          android:layout_weight="1"
                          android:gravity="left"
                          android:paddingTop="10dp"
                          android:text="Sport Event"
                          android:textColor="#000"
                          android:textSize="10dp" /&gt;
                  &lt;/TableRow&gt;
  
                  &lt;TableRow
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:paddingTop="2dp" &gt;
  
                      &lt;ImageView
                          android:layout_width="0dp"
                          android:layout_height="30dp"
                          android:layout_gravity="right"
                          android:layout_weight="1"
                          android:adjustViewBounds="true"
                          android:src="@drawable/races" /&gt;
  
                      &lt;TextView
                          android:layout_width="0dp"
                          android:layout_height="wrap_content"
                          android:layout_weight="1"
                          android:gravity="left"
                          android:paddingTop="10dp"
                          android:text="Festival Celebration"
                          android:textColor="#000"
                          android:textSize="10dp" /&gt;
  
                      &lt;ImageView
                          android:layout_width="0dp"
                          android:layout_height="30dp"
                          android:layout_gravity="right"
                          android:layout_weight="1"
                          android:adjustViewBounds="true"
                          android:src="@drawable/discussion" /&gt;
  
                      &lt;TextView
                          android:layout_width="0dp"
                          android:layout_height="wrap_content"
                          android:layout_weight="1"
                          android:gravity="left"
                          android:paddingTop="10dp"
                          android:text="Chit Chat Session"
                          android:textColor="#000"
                          android:textSize="10dp" /&gt;
                  &lt;/TableRow&gt;
              &lt;/TableLayout&gt;
          &lt;/LinearLayout&gt;
  
          &lt;TextView
              android:id="@+id/tvSearchTitle"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_above="@+id/llSearch"
              android:background="@color/lightred"
              android:gravity="center"
              android:paddingBottom="5dp"
              android:text="Address Search"
              android:textColor="#FFFFFF" &gt;
          &lt;/TextView&gt;
  
          &lt;LinearLayout
              android:id="@+id/llSearch"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_alignParentBottom="true"
              android:background="#FFFFFF"
              android:orientation="horizontal"
              android:padding="5dp"
              android:weightSum="1" &gt;
  
              &lt;EditText
                  android:id="@+id/searchAddrET"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="5dp"
                  android:layout_weight="0.8"
                  android:hint="Enter search address, eg. postal code"
                  android:textSize="12dp" /&gt;
  
              &lt;Button
                  android:id="@+id/btnSearchAddr"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="5dp"
                  android:layout_weight="0.2"
                  android:background="@color/lightred"
                  android:minHeight="30dp"
                  android:text="Search"
                  android:textColor="#FFFFFF"
                  android:textSize="12dp" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;TextView
              android:id="@+id/tvDirectionTitle"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_above="@+id/llDirection"
              android:background="@color/lightred"
              android:gravity="center"
              android:paddingBottom="5dp"
              android:text="Direction"
              android:textColor="#FFFFFF"
              android:visibility="gone" &gt;
          &lt;/TextView&gt;
  
          &lt;LinearLayout
              android:id="@+id/llDirection"
              android:layout_width="fill_parent"
              android:layout_height="80dp"
              android:layout_alignParentBottom="true"
              android:background="#FFFFFF"
              android:padding="5dp"
              android:visibility="gone" &gt;
  
              &lt;ScrollView
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content" &gt;
  
                  &lt;TextView
                      android:id="@+id/tvDirection"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content" &gt;
                  &lt;/TextView&gt;
              &lt;/ScrollView&gt;
          &lt;/LinearLayout&gt;
      &lt;/RelativeLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>When it was working fine, I wrapped the map view and the rests of the layout with a frame layout. And then inside the class where I extended the navigation drawer:</p>
  
  <pre><code>public class EventMain extends NavigationDrawer {
  
  public static MapView mMapView = null;
  ArcGISTiledMapServiceLayer tileLayer;
  LocationManager locationManager;
  public static GraphicsLayer graphicsLayer = null;
  public static Callout callout;
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      ViewGroup content = (ViewGroup) findViewById(R.id.event_frame);
      getLayoutInflater().inflate(R.layout.event_main, content, true);   
  }
  </code></pre>
  
  <p>The problem that I was having now was all the other components is not showing on top of the map view. Any guides?</p>
  
  <p>Thanks in advance.</p>