TextView ignores gradient - Android
<p>I've got a TextView overlayed on a image, with a gradient which acts as a background. However as you can see in the image, for some reason the TextView is using the android:startColor colour as a solid background instead.</p>

<p><img src="http://i.stack.imgur.com/rduND.jpg" alt="enter image description here"></p>

<p>Gradient.xml</p>

<pre><code>&lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"&gt;
&lt;gradient
    android:endColor="#00000000"
    android:startColor="#FF999999"
    android:angle="90"/&gt;    
&lt;/shape&gt;
</code></pre>

<p>onCreate in MainActivity</p>

<pre><code> View overlay = (View) findViewById(R.id.overlay);
    overlay.setBackgroundResource(R.drawable.gradient);
   FrameLayout.LayoutParams params =
      new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FILL_PARENT, 250);
    params.gravity = Gravity.BOTTOM;
   overlay.setLayoutParams(params);
   overlay.invalidate(); // update the view 
</code></pre>

<p>main_activity.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:background="#999999"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity" &gt;
&lt;FrameLayout 
android:layout_width="match_parent"
android:layout_height="250dp"
&gt;
&lt;ImageView
    android:id="@+id/imageView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:adjustViewBounds="true"
    android:scaleType="fitXY"
    android:src="@drawable/statement_header" /&gt;
&lt;View
    android:id="@+id/overlay"
    android:layout_width="fill_parent"
    android:layout_height="100dp"
  /&gt;

&lt;TextView android:id="@+id/tvHeader"
         android:layout_width="wrap_content"
          android:layout_height="wrap_content" 
          android:textSize="20sp"
          android:textStyle="bold"
          android:text="Our Story"
          android:textColor="#FFFFFF"
          android:background="#00000000"
          android:maxLines="1"
          android:layout_marginLeft="8dp"
          android:layout_marginRight="8dp"
          android:layout_gravity="bottom" android:layout_alignParentBottom="true"
          /&gt;
&lt;/FrameLayout&gt;
</code></pre>
