35

Scrollable views such as the ListView have a fade out of the content along the edges where there is more content in that direction. How can I turn this fading off? I know you can change the cacheColorHint as discussed here: http://developer.android.com/resources/articles/listview-backgrounds.html but that is not what I am looking for and will not achieve what I am looking for in this case.

I want to disable the fade completely or be able to reduce the size and or transparency of it. Is this possible?

cottonBallPaws
  • 21,220
  • 37
  • 123
  • 171

4 Answers4

85

I can't actually test it right now, but I believe fadingEdge is what you're looking for:

android:fadingEdge="none"

or

listView.setVerticalFadingEdgeEnabled(false);

http://developer.android.com/reference/android/view/View.html#setVerticalFadingEdgeEnabled(boolean)

Kevin Coppock
  • 133,643
  • 45
  • 263
  • 274
  • 1
    That did it! Thank you. Also, I see there is a field called android:fadingEdgeLength for controlling the length of the fade. Thanks again. – cottonBallPaws Nov 09 '10 at 04:39
  • 2
    It should be noted that fadingedges is disabled per default for all scrollviews from ice cream sandwich and henceforth (http://commonsware.com/blog/2011/10/19/curiosities-ice-cream-sandwich.html) – Warpzit Jul 11 '12 at 12:18
  • 1
    Heh, funny that this answer comes back to help ME. Thanks @Warpzit, I was actually wondering yesterday why my fading edge wasn't working on ICS. :) – Kevin Coppock Jul 11 '12 at 12:25
  • @kcoppock heh well I figured it out because I was wondering why fadingedge was deprecated :) Glad it already helped someone :D – Warpzit Jul 11 '12 at 12:50
49

In case someone finds this via Google:

As mentioned, android:fadingEdge is deprecated. Use this instead:

android:overScrollMode="never"
Christoph Bach
  • 598
  • 4
  • 9
9

Late answer, but at this point to maintain backwards compatibility with API 13 and below, use both android:requiresFadingEdge="none" and android:fadingEdge="none" together.

pqn
  • 1,522
  • 3
  • 22
  • 33
0

If you targetSdkVersion >= 14 than there will be no fading edges.

android:requiresFadingEdge

can help you to get them back.

source

k4dima
  • 6,070
  • 5
  • 41
  • 39