title: Android put Cardview top of parent Cardview in RelativeLayout
body: <p>how can i put <code>cardview</code> on top of parent <code>cardview</code> in below screen shot?</p>
  
  <p><a href="https://i.stack.imgur.com/NcWEh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NcWEh.png" alt="enter image description here"></a></p>
  
  <p>when i put image to <code>CardView</code> that cause of broken my view</p>
  
  <p>correct view must be:</p>
  
  <p><a href="https://i.stack.imgur.com/YwRea.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YwRea.png" alt="enter image description here"></a></p>
  
  <p>My xml layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/content_background"&gt;
  
      &lt;android.support.design.widget.CoordinatorLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical"&gt;
  
              &lt;android.support.design.widget.AppBarLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"&gt;
  
                  &lt;android.support.v7.widget.Toolbar
                      android:id="@+id/activity_main_toolbar"
                      android:layout_width="match_parent"
                      android:layout_height="65dp"
                      android:background="@color/colorPrimary"
                      android:titleTextColor="#ffffff"&gt;
  
                      &lt;LinearLayout
                          android:layout_width="match_parent"
                          android:layout_height="match_parent"
                          android:orientation="horizontal"&gt;
  
                          &lt;com.joanzapata.iconify.widget.IconTextView
                              android:id="@+id/icon_signal_robot"
                              android:layout_width="wrap_content"
                              android:layout_height="match_parent"
                              android:layout_marginRight="10dp"
                              android:clickable="true"
                              android:gravity="center|right"
                              android:shadowColor="#22000000"
                              android:shadowDx="3"
                              android:shadowDy="3"
                              android:shadowRadius="1"
                              android:text="{fa-android}"
                              android:textColor="@color/quote"
                              android:textSize="30sp"/&gt;
  
                          &lt;com.joanzapata.iconify.widget.IconTextView
                              android:id="@+id/icon_search_icon"
                              android:layout_width="wrap_content"
                              android:layout_height="match_parent"
                              android:layout_marginRight="10dp"
                              android:clickable="true"
                              android:gravity="center|right"
                              android:shadowColor="#22000000"
                              android:shadowDx="3"
                              android:shadowDy="3"
                              android:shadowRadius="1"
                              android:text="{fa-search}"
                              android:textColor="#ffffff"
                              android:textSize="25sp"/&gt;
  
                          &lt;com.gigamole.library.ntb.NavigationTabBar
                              android:id="@+id/market_detail_navigation_tab_bar"
                              android:layout_width="90dp"
                              android:layout_height="30dp"
                              android:layout_gravity="center_vertical|left"
                              android:background="@drawable/bg_round_circle"
                              app:ntb_active_color="#4527A0"
                              app:ntb_animation_duration="150"
                              app:ntb_corners_radius="50dp"
                              app:ntb_inactive_color="#dddfec"
                              app:ntb_preview_colors="@array/red_wine"/&gt;
  
                          &lt;TextView
                              android:id="@+id/signal_application_detail_activity_title"
                              android:layout_width="0dp"
                              android:layout_height="match_parent"
                              android:layout_weight="1"
                              android:clickable="true"
                              android:gravity="center|right"
                              android:text="@string/app_name"
                              android:textColor="#ffffff"
                              android:textSize="19sp"/&gt;
  
                          &lt;ImageView
                              android:id="@+id/activity_main_hearing_status"
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:layout_gravity="center"
                              android:layout_marginLeft="5dp"
                              android:layout_marginRight="10dp"
                              android:gravity="center|right"
                              android:src="@drawable/ic_antenna_white"/&gt;
  
                      &lt;/LinearLayout&gt;
                  &lt;/android.support.v7.widget.Toolbar&gt;
              &lt;/android.support.design.widget.AppBarLayout&gt;
  
              &lt;LinearLayout
                  android:id="@+id/signal_loading_view"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:layout_gravity="center"
                  android:background="@color/colorPrimary"
                  android:gravity="center"
                  android:orientation="vertical"
                  android:visibility="gone"&gt;
  
                  &lt;TextView
                      android:id="@+id/loading_view_title"
                      android:layout_width="match_parent"
                      android:layout_height="50dp"
                      android:gravity="center"
                      android:text="@string/app_name"
                      android:textColor="#FFF"
                      android:textSize="35sp"
                      /&gt;
  
                  &lt;TextView
                      android:id="@+id/loading_view_description"
                      android:layout_width="match_parent"
                      android:layout_height="50dp"
                      android:gravity="center"
                      android:text="@string/app_description"
                      android:textColor="#FFF"
                      android:textSize="18dp"
                      /&gt;
  
                  &lt;com.zl.reik.dilatingdotsprogressbar.DilatingDotsProgressBar
                      android:id="@+id/dots_progressBar"
                      android:layout_width="match_parent"
                      android:layout_height="30dp"
                      android:color="#ffee00"
                      android:radius="4dp"
                      app:dd_animationDuration="300"
                      app:dd_horizontalSpacing="7dp"
                      app:dd_numDots="5"
                      app:dd_scaleMultiplier="1.5"
                      /&gt;
              &lt;/LinearLayout&gt;
  
              &lt;RelativeLayout
                  android:id="@+id/frame"
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:app="http://schemas.android.com/apk/res-auto"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:layout_gravity="center_vertical"
                  android:background="@drawable/content_background"&gt;
  
                  &lt;android.support.v7.widget.CardView
                      android:id="@+id/malam"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"&gt;
  
                      &lt;ImageView
                          android:id="@+id/imageView2"
                          android:layout_width="match_parent"
                          android:layout_height="230dp"
                          android:scaleType="centerCrop"
                          android:src="@drawable/background"/&gt;
                  &lt;/android.support.v7.widget.CardView&gt;
  
  
                  &lt;LinearLayout
                      android:id="@+id/linearLayout3"
                      android:layout_width="match_parent"
                      android:layout_height="180dp"
                      android:layout_alignParentTop="true"
                      android:layout_centerHorizontal="true"
                      android:layout_centerVertical="true"
                      android:layout_marginLeft="30dp"
                      android:layout_marginRight="30dp"
                      android:layout_marginTop="120dp"
                      android:fitsSystemWindows="true"
                      android:orientation="vertical"&gt;
  
                      &lt;android.support.v7.widget.CardView
                          android:layout_width="match_parent"
                          android:layout_height="match_parent"
                          android:layout_alignParentLeft="true"
                          android:layout_alignParentStart="true"
                          android:layout_alignParentTop="true"
                          app:cardCornerRadius="0dp"
                          app:elevation="2dp"&gt;
  
                      &lt;/android.support.v7.widget.CardView&gt;
                  &lt;/LinearLayout&gt;
                  &lt;ImageView
                      android:id="@+id/robot_dialog_icon"
                      android:layout_width="65dp"
                      android:layout_height="65dp"
                      android:layout_alignBottom="@+id/malam"
                      android:layout_centerHorizontal="true"
                      android:layout_marginBottom="75dp"
                      android:fitsSystemWindows="true"
                      android:src="@drawable/dialog_robot_dialog"
                      app:layout_collapseMode="parallax"/&gt;
              &lt;/RelativeLayout&gt;
  
          &lt;/LinearLayout&gt;
      &lt;/android.support.design.widget.CoordinatorLayout&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>