Is there a way to disable/edit the fading that a list view has at its edges?

27,572

Solution 1

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)

Solution 2

In case someone finds this via Google:

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

android:overScrollMode="never"

Solution 3

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.

Share:
27,572
cottonBallPaws
Author by

cottonBallPaws

Updated on April 15, 2020

Comments

  • cottonBallPaws
    cottonBallPaws about 4 years

    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
    cottonBallPaws over 13 years
    That did it! Thank you. Also, I see there is a field called android:fadingEdgeLength for controlling the length of the fade. Thanks again.
  • Warpzit
    Warpzit almost 12 years
    It should be noted that fadingedges is disabled per default for all scrollviews from ice cream sandwich and henceforth (commonsware.com/blog/2011/10/19/…)
  • Kevin Coppock
    Kevin Coppock almost 12 years
    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. :)
  • Warpzit
    Warpzit almost 12 years
    @kcoppock heh well I figured it out because I was wondering why fadingedge was deprecated :) Glad it already helped someone :D
  • tomrozb
    tomrozb over 10 years
    The only solution that worked for me on 4.3. All the suggestions above simply don't work.
  • speedynomads
    speedynomads over 10 years
    The accepted answer is out of date. This is the correct solution.
  • Suvitruf - Andrei Apanasik
    Suvitruf - Andrei Apanasik almost 10 years
    If i need disable fadingEdge but without disabling OverScroll?
  • Adib Faramarzi
    Adib Faramarzi over 9 years
    this solution should be accepted , its the preferred way to do it.
  • kit
    kit about 6 years
    Works for RecyclerView too, tested