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

Andrew Shooner picture Andrew Shooner · Apr 14, 2010 · Viewed 43.5k times · Source

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.

Answer

LEHO picture LEHO · Oct 5, 2010

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);
}