开发者

Changing the ListView shadow color and size

When the list of items in a ListView is longer than the size of the ListView, you'll see a shadow indicating that there are more items above or below. B开发者_Go百科y default, this shadow is black. This is not desirable.

If I set the cacheColorHint to the following:

android:cacheColorHint="#00000000"

The shadow will be transparent, showing the drawable I have set to the layout's background. This is not desirable either.

I wish to simply change the color of the shadow to a lighter shade of black, or perhaps gray. Is there a way to specify this?

Also, is there a way to change the shadow's size?


By android:cacheColorHint="#00000000" you are setting this color to transparent. I don't know which color you want to use exactly, but try android:cacheColorHint="#FF777777". I think it must work.


I wouldn't delete your question yet, you still had the remaining question of how to change the size. :)

You can use the method setFadingEdgeLength(int length) to do this; it's directly inherited from View, so just about any View should be able to use it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜