Fading at the bottom of a scrollable list on Android?

I have a long ListView with a white background ( android:background="@android:color/white" ) and a transparent cache color ( android:cacheColorHint="#00000000" ). Two questions:

  • I am testing on various devices. On older models, Fade works fine. But on new ones, I don’t see any attenuation at all, just a sharp cutoff. Why is this possible and how can I fix it?

  • Many times the elements in my list line up so that there are enough spaces below that the fade does not reach the text and is not visible. Is there a way to make a fading cover larger than a list?

+6
source share
1 answer

Found own answers:

  • android:requiresFadingEdge="vertical"
  • android:fadingEdgeLength="48dp"

EDIT: go to dp instead of sp

+23
source

Source: https://habr.com/ru/post/925943/


All Articles