Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the color of an Android ScrollView fading edge?

I have an Android scrollview with a white background. The fading edge is a white translucent gradient. I would like to change it be black instead of white. I have a ListView in the same project with a white background that has a black fading edge by default, but I can't find where (if anywhere) that was set.

like image 564
Andrew Shooner Avatar asked Apr 14 '10 20:04

Andrew Shooner


2 Answers

If you want a different color fading edge than the background, you have to override the ScrollView's getSolidColor() method. For example:

@Override
public int getSolidColor() {
    return Color.rgb(0x30, 0x30, 0x30);
}
like image 73
LEHO Avatar answered Nov 11 '22 01:11

LEHO


Just found it out by trial and error.

Simply set android:background="@color/yourColor" for the <ScrollView>. It will set the shadow to the given colour.

like image 43
digitarald Avatar answered Nov 11 '22 01:11

digitarald