title: scrollview covers up image view
body: <p>I am trying to make a layout in which there are two main layouts. 
  One is an imageview and the second one is a scrollview. What I want is that the imageview is always kept on top of the scrollview. When I run the program the image goes back to the scrollview.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@android:color/white"
      android:orientation="vertical" &gt;
  
      &lt;FrameLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent" &gt;
  
          &lt;ImageView
              android:id="@+id/img_back"
              android:layout_width="30dp"
              android:layout_height="30dp"
              android:layout_gravity="left|top"
              android:layout_margin="10dp"
              android:background="@android:color/black"
              android:contentDescription="@null"
              android:src="@drawable/back" /&gt;
  
          &lt;ScrollView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_alignParentTop="true"
              android:scrollbars="none" &gt;
  
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:orientation="vertical" &gt;
  
                  &lt;!-- Top linear layout --&gt;
  
                  &lt;LinearLayout
                      android:id="@+id/ll_above_map"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:orientation="vertical" &gt;
  
                      &lt;RelativeLayout
                          android:layout_width="match_parent"
                          android:layout_height="250dp" &gt;
  
                          &lt;com.shotwell.customviews.SmartViewPager
                              android:id="@+id/vp_slider"
                              android:layout_width="match_parent"
                              android:layout_height="match_parent" /&gt;
  
                          &lt;com.viewpagerindicator.CirclePageIndicator
                              android:id="@+id/dots"
                              android:layout_width="match_parent"
                              android:layout_height="10dp"
                              android:layout_alignParentTop="true"
                              android:layout_centerHorizontal="true"
                              android:layout_marginTop="20dp" /&gt;
                          &lt;!--
                  &lt;ImageView
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:contentDescription="@null"
                      android:scaleType="centerCrop"
                      android:src="@drawable/bigimage" /
                          --&gt;
  &gt;
  
                          &lt;TextView
                              android:id="@+id/tv_subtitle"
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:layout_alignParentBottom="true"
                              android:layout_marginBottom="10dp"
                              android:layout_marginLeft="10dp"
                              android:layout_marginTop="20dp"
                              android:text="Pan-Asian"
                              android:textColor="@android:color/white"
                              android:textSize="18sp"
                              android:textStyle="normal" /&gt;
  
                          &lt;TextView
                              android:id="@+id/tv_title"
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:layout_above="@id/tv_subtitle"
                              android:layout_alignLeft="@id/tv_subtitle"
                              android:text="Oka"
                              android:textColor="@android:color/white"
                              android:textSize="25sp"
                              android:textStyle="bold" /&gt;
  
                          &lt;TextView
                              android:id="@+id/tv_status"
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:layout_alignBottom="@id/tv_subtitle"
                              android:layout_marginLeft="16dp"
                              android:layout_toRightOf="@+id/tv_subtitle"
                              android:background="@drawable/open_btn"
                              android:focusable="false"
                              android:gravity="center"
                              android:text="Open"
                              android:textColor="@android:color/white" /&gt;
                      &lt;/RelativeLayout&gt;
  
                      &lt;RelativeLayout
                          android:layout_width="match_parent"
                          android:layout_height="40dp"
                          android:background="#878787" &gt;
  
                          &lt;TextView
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:layout_alignParentLeft="true"
                              android:layout_centerVertical="true"
                              android:layout_marginLeft="10dp"
                              android:text="56"
                              android:textColor="@android:color/black"
                              android:visibility="gone" /&gt;
  
                          &lt;RatingBar
                              android:id="@+id/rb_rating"
                              style="@style/StarRatingBar"
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:layout_alignParentRight="true"
                              android:layout_centerVertical="true"
                              android:rating="5.0" /&gt;
                      &lt;/RelativeLayout&gt;
  
                      &lt;LinearLayout
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_margin="10dp"
                          android:orientation="vertical" &gt;
  
                          &lt;TextView
                              android:id="@+id/tv_desc_toggle"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              android:text="Description"
                              android:textColor="#6A6A6A"
                              android:textSize="22sp"
                              android:textStyle="bold" /&gt;
  
                          &lt;TextView
                              android:id="@+id/tv_desc"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              android:text="@string/dummy_list_text"
                              android:textColor="@color/dark_gray" /&gt;
  
                          &lt;LinearLayout
                              android:layout_width="match_parent"
                              android:layout_height="1dp"
                              android:background="@android:color/darker_gray" &gt;
                          &lt;/LinearLayout&gt;
                      &lt;/LinearLayout&gt;
                  &lt;/LinearLayout&gt;
  
                  &lt;RelativeLayout
                      android:id="@+id/rl_map_holder"
                      android:layout_width="match_parent"
                      android:layout_height="200dp"
                      android:layout_margin="10dp" &gt;
  
                      &lt;com.google.android.gms.maps.MapView
                          android:id="@+id/mapview"
                          android:layout_width="match_parent"
                          android:layout_height="match_parent" /&gt;
  
                      &lt;TextView
                          android:id="@+id/tv_full_map"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:layout_margin="10dp"
                          android:text="FullScreen"
                          android:textColor="@android:color/black"
                          android:textStyle="bold" /&gt;
                  &lt;/RelativeLayout&gt;
  
                  &lt;!-- bottom layout --&gt;
  
                  &lt;LinearLayout
                      android:id="@+id/ll_below_map"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:orientation="vertical" &gt;
  
                      &lt;LinearLayout
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_marginLeft="10dp"
                          android:orientation="vertical" &gt;
  
                          &lt;TextView
                              android:id="@+id/tv_address_city"
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:padding="1dp"
                              android:text="Berlin Top, Fiapre Suryani"
                              android:textColor="@android:color/black"
                              android:textSize="12sp" /&gt;
  
                          &lt;TextView
                              android:id="@+id/tv_state_country"
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:padding="1dp"
                              android:text="Brong Afoo, Ghana"
                              android:textColor="@android:color/black"
                              android:textSize="12sp" /&gt;
  
                          &lt;LinearLayout
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              android:layout_marginTop="6dp"
                              android:orientation="horizontal" &gt;
  
                              &lt;TextView
                                  android:layout_width="wrap_content"
                                  android:layout_height="wrap_content"
                                  android:text="Phone no: "
                                  android:textColor="@android:color/black"
                                  android:textSize="12sp"
                                  android:textStyle="bold" /&gt;
  
                              &lt;TextView
                                  android:id="@+id/tv_phone"
                                  android:layout_width="wrap_content"
                                  android:layout_height="wrap_content"
                                  android:text=" 024133556677"
                                  android:textColor="@android:color/black"
                                  android:textSize="12sp" /&gt;
                          &lt;/LinearLayout&gt;
  
                          &lt;LinearLayout
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              android:orientation="horizontal" &gt;
  
                              &lt;TextView
                                  android:layout_width="wrap_content"
                                  android:layout_height="wrap_content"
                                  android:text="Email: "
                                  android:textColor="@android:color/black"
                                  android:textSize="12sp"
                                  android:textStyle="bold" /&gt;
  
                              &lt;TextView
                                  android:id="@+id/tv_email"
                                  android:layout_width="wrap_content"
                                  android:layout_height="wrap_content"
                                  android:text="abc@yahoo.com"
                                  android:textColor="@android:color/black"
                                  android:textSize="12sp" /&gt;
                          &lt;/LinearLayout&gt;
  
                          &lt;LinearLayout
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              android:layout_marginBottom="10dp"
                              android:orientation="horizontal" &gt;
  
                              &lt;TextView
                                  android:layout_width="wrap_content"
                                  android:layout_height="wrap_content"
                                  android:text="URL: "
                                  android:textColor="@android:color/black"
                                  android:textSize="12sp"
                                  android:textStyle="bold" /&gt;
  
                              &lt;TextView
                                  android:id="@+id/tv_url"
                                  android:layout_width="wrap_content"
                                  android:layout_height="wrap_content"
                                  android:text="www.newstate.com"
                                  android:textColor="@android:color/black"
                                  android:textSize="12sp" /&gt;
                          &lt;/LinearLayout&gt;
                      &lt;/LinearLayout&gt;
  
                      &lt;LinearLayout
                          android:id="@+id/ll_container_facility"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_margin="10dp"
                          android:orientation="vertical" &gt;
  
                          &lt;TextView
                              android:id="@+id/tv_toggle_facilities"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              android:text="Facilities"
                              android:textColor="#6A6A6A"
                              android:textSize="22sp"
                              android:textStyle="bold" /&gt;
  
                          &lt;LinearLayout
                              android:id="@+id/ll_facilities"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              android:orientation="vertical" /&gt;
                          &lt;!--
                           &lt;TextView
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:text="@string/dummy_list_text"
                          android:textColor="@color/dark_gray" /&gt;
                          --&gt;
  
                          &lt;LinearLayout
                              android:layout_width="match_parent"
                              android:layout_height="1dp"
                              android:background="@android:color/darker_gray" &gt;
                          &lt;/LinearLayout&gt;
                      &lt;/LinearLayout&gt;
  
                      &lt;LinearLayout
                          android:id="@+id/ll_container_hours"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_margin="10dp"
                          android:orientation="vertical" &gt;
  
                          &lt;TextView
                              android:id="@+id/tv_toggle_timing"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              android:text="Hours"
                              android:textColor="#6A6A6A"
                              android:textSize="22sp"
                              android:textStyle="bold" /&gt;
  
                          &lt;LinearLayout
                              android:id="@+id/ll_timings"
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              android:orientation="vertical" /&gt;
  
                          &lt;LinearLayout
                              android:layout_width="match_parent"
                              android:layout_height="1dp"
                              android:layout_marginTop="0dp"
                              android:background="@android:color/darker_gray" &gt;
                          &lt;/LinearLayout&gt;
                      &lt;/LinearLayout&gt;
                  &lt;/LinearLayout&gt;
              &lt;/LinearLayout&gt;
          &lt;/ScrollView&gt;
      &lt;/FrameLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>It's the code of activity. which I am using. Resultant screen looks like this.<a href="https://i.stack.imgur.com/47ITW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/47ITW.png" alt="here is the image of output"></a></p>
  
  <p>So in layouts it shows lines where I place my imageview but it won't show up.
  I think maybe the scrollview is pushing back the imageview.
  So how to put my imageview on top of the scrollview ?</p>