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

别说谁变了你拦得住时间么 提交于 2019-11-28 23:40:50

问题


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?


回答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)




回答2:


In case someone finds this via Google:

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

android:overScrollMode="never"



回答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.




回答4:


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

android:requiresFadingEdge

can help you to get them back.

source



来源:https://stackoverflow.com/questions/4130461/is-there-a-way-to-disable-edit-the-fading-that-a-list-view-has-at-its-edges

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!