title: How to apply drawable shape Gradient to android.support.v7.widget.CardView in android
body: <p>I can't set background gradient to <strong>android.support.v7.widget.CardView</strong></p>
  
  <p>Using <code>app:cardBackgroundColor="@somecolor"</code> this i only set background color, <strong>not drawable resourse file</strong></p>
  
  <pre><code>&lt;android.support.v7.widget.CardView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:cardBackgroundColor="@drawable/bg"&gt; // not working in CardView
  
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <h2>bg.xml</h2>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"&gt;
      &lt;gradient android:angle="45" android:startColor="@android:color/black"
          android:endColor="@android:color/black"
          android:centerColor="@android:color/holo_red_dark"
          android:centerX="4"
          /&gt;
  &lt;/shape&gt;
  </code></pre>