title: Android - elevation in linearlayout
body: <p>I want to add shadow effect to the linearlayout using elevation. Here is my xml code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/searchFragment"&gt;
  
      &lt;RelativeLayout
          android:id="@+id/RelativeLayout02"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:background="#ffffff"&gt;
              &lt;RelativeLayout
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  android:orientation="horizontal"
                  android:clipToPadding="false"
                  android:paddingBottom="5dp"&gt;
  
                  &lt;LinearLayout
                      android:orientation="horizontal"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:id="@+id/linearLayout"
                      android:paddingBottom="5dp"
                      android:elevation="8dp"&gt; ---&gt; here should be elevation
  
                      &lt;LinearLayout
                          android:orientation="vertical"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:paddingBottom="5dp"
                          android:layout_marginRight="55dp"&gt;
  
                          &lt;AutoCompleteTextView
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              android:id="@+id/fromStationField"
                              android:completionThreshold="1"
                              android:hint="From"
                              android:textAlignment="textStart"
                              android:gravity="left|start"
                              android:layout_gravity="left" /&gt;
  
                          &lt;AutoCompleteTextView
                              android:layout_width="match_parent"
                              android:layout_height="wrap_content"
                              android:id="@+id/toStationField"
                              android:completionThreshold="1"
                              android:hint="To"
                              android:background="@android:color/transparent"
                              android:paddingRight="4dp"
                              android:paddingLeft="4dp" /&gt;
                      &lt;/LinearLayout&gt;
  
                      &lt;ImageView
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:id="@+id/swapButton"
                          android:src="@drawable/ic_swap"
                          android:layout_gravity="center_vertical"
                          android:layout_marginLeft="-55dp"/&gt;
                  &lt;/LinearLayout&gt;
  
                  &lt;android.support.design.widget.CoordinatorLayout
                      android:id="@+id/main_content"
                      xmlns:android="http://schemas.android.com/apk/res/android"
                      xmlns:app="http://schemas.android.com/apk/res-auto"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_below="@+id/linearLayout"&gt;
  
                  &lt;android.support.v7.widget.RecyclerView
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:id="@+id/scheduleListRecyclerView"
                      android:layout_centerHorizontal="true"
                      android:layout_marginLeft="10dp"
                      android:layout_marginRight="10dp" /&gt;
  
                  &lt;android.support.design.widget.FloatingActionButton
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="bottom|right"
                      android:layout_margin="16dp"
                      app:layout_anchor="@id/scheduleListRecyclerView"
                      app:layout_anchorGravity="bottom|right|end"
                      app:layout_behavior="com.standart.trainschedule.FABScrollBehavior"
                      android:src="@drawable/abc_btn_rating_star_on_mtrl_alpha"
                      android:visibility="gone"
                      android:id="@+id/fab" /&gt;
  
                  &lt;/android.support.design.widget.CoordinatorLayout&gt;
              &lt;/RelativeLayout&gt;
      &lt;/RelativeLayout&gt;
  &lt;/LinearLayout&gt; 
  </code></pre>
  
  <p>The problem is if I run this on my phone, the shadow doesn't appear but in Preview mode in Android Studio the shadow shows correctly. How to fix it ?</p>