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?
view. setEnabled(false); Use this if you want to disable the listItem which user has clicked. Thus prevents the onclick event on that particular item.
We've learned how to implement the ListView, bind the data with the adapter and how to improve scrolling using ViewHolder pattern. It's worth to mentioned that the ListView is a kind of deprecated because the RecyclerView was introduced with the API 21 (Android Lollipop).
Simple answer: You should use RecyclerView in a situation where you want to show a lot of items, and the number of them is dynamic. ListView should only be used when the number of items is always the same and is limited to the screen size.
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)
In case someone finds this via Google:
As mentioned, android:fadingEdge
is deprecated. Use this instead:
android:overScrollMode="never"
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With