android - Transparent gradient issue -


i have layout google map fragment in framelayout. also, placed new view on map gradient background. layout:

<framelayout     android:layout_width="match_parent"     android:layout_height="0dp"     android:layout_weight="1"     >      <com.google.android.gms.maps.mapview         android:id="@+id/mapview"         android:layout_width="match_parent"         android:layout_height="match_parent"/>      <view         android:id="@+id/fadetop"         android:layout_width="match_parent"         android:layout_height="@dimen/fade_height"         android:layout_gravity="top"         android:background="@drawable/list_fade_top"/>     <include layout="@layout/top_line_mid_gray"/>  </framelayout> 

list_fade_top:

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">     <gradient         android:angle="90"               android:startcolor="@color/fade_start_color"               android:centercolor="@color/fade_center_color"               android:endcolor="@color/fade_end_color"         android:type="linear"/> </shape> 
  1. start/end , center colors. gradient draws 2 light lines:

<color name="fade_start_color">#00000000</color> <color name="fade_center_color">#4f000000</color> <color name="fade_end_color">#ff000000</color> enter image description here

  1. start/end , center colors. gradient draws 1 light line:

<color name="fade_start_color">#00000000</color> <color name="fade_center_color">#6f000000</color> <color name="fade_end_color">#ff000000</color> enter image description here

  1. the same behavior gradient without center color:

    <gradient     android:angle="90"           android:startcolor="@color/fade_start_color"           android:endcolor="@color/fade_end_color"     android:type="linear"/> 

enter image description here

how can draw smooth linear gradient black (or semi transparent black) full transparent?

i tried hardware acceleration on/off, 'getwindow().setformat(pixelformat.rgba_8888);' nothing helps me.

update 1 created simple app @ github. https://github.com/ralexey/testapp activity color background , gradient on it.

add line in gradient android:centery="y%p" may you

<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"     android:shape="rectangle" >      <gradient         android:angle="90"         android:centery="25%p"         android:centercolor="@color/fade_center_color"         android:endcolor="@color/fade_end_color"         android:startcolor="@color/fade_start_color"         android:type="linear"         android:dither="true"         android:uselevel="true" />  </shape> 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -