How to make a transparent gradient?

I have the following gradient:

<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#ECECEC" android:centerColor="#F6F6F4" android:endColor="#F8F8F6" android:angle="90" android:dither="true" /> </shape> 

I want this to be transparent, because in my ListView I set this as my ListSelector:

 <ListView android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ARListView" android:background="@drawable/transparent_background" android:cacheColorHint="#00000000" android:drawSelectorOnTop="true" android:listSelector="@drawable/stocks_selected_gradient"> </ListView> 
+53
android listview transparency gradient
Sep 29 '10 at 16:18
source share
2 answers

Just use an 8 digit color value, for example. # FFF8F8F6, where the first two characters are an alpha value. FF is completely opaque, and 00 is completely transparent.

+103
Sep 29 '10 at 17:53
source share

android: background = "# 00000000" android: cacheColorHint = "# 00000000"

this will make it transparent, however, to make it completely transparent ...

+3
Oct 19 2018-10-19
source share



All Articles