ITeye博客

为什么listview的item变黑了

video.android · 2009-06-13 11:26 · 技术文档 · Markdown

今天开发时碰到一个问题,我的listview有背景图片,但当点击listview下方的空白区域时,listview中的item背景变成了黑色.

我还以为是android的一个bug,但上google上搜了一下,在下面的文章中找到了答案.

http://android-developers.blogspot.com/2009/01/why-is-my-list-black-android.html

This technique is used throughout the system to indicate that the container can be scrolled.

This rendering issue is caused by an optimization of the Android framework enabled by default on all instances of ListView.

不过文中也提出了解决方法,设置一下listview的xml属性就可以解决了. android:cacheColorHint="#00000000"

当然,原文作者也承认,这样的作法给开发者带来了不便.

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。