ListView控件在Android的“空白”区域的设置颜色 [英] Set color of 'empty' area of ListView in Android

查看:480
本文介绍了ListView控件在Android的“空白”区域的设置颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的列表视图不完全名单视图中的项目(如我的列表视图是足够高的8个项目,但我只有2),空白区域显示为灰色在我的Droid X.在模拟器中空白区域显示为黑色。

When my list view is not completely full of list view items (ex my list view is tall enough for 8 items, but I only have 2), the empty area shows up as gray on my Droid X. In the emulator the empty area shows up as black.

我如何设置'空'区域为透明?

How do I set the 'empty' area to transparent?

我已经尝试设置背景颜色,缓存的提示,但这些似乎只是改变地方有项目,列表视图的背景色不是空区域。

I've tried setting the background color, cache hints, but those only seem the change the background color of the listview where it has items, not the empty area.

推荐答案

摩托罗拉曾经有一个博客张贴有关此行为,但他们的博客不再是在线 - 答案是对的Motoblur 2.3,他们设置默认overscroll页脚,这是可以解决通过设置安卓overScrollFooter =@空,但只针对Android 2.3+。

Motorola used to have a blog post up about this behavior, but their blog is no longer online -- the answer is that on Motoblur 2.3, they set a default overscroll footer, which is fixable by setting android:overScrollFooter="@null", but only for Android 2.3+.

推荐的应用范围内的解决方案是使用自定义主题带有自定义 listViewStyle 仅在值-V10设置文件夹与属性集。

Their recommended app-wide solution is to use a custom theme with a custom listViewStyle set only in the values-v10 folder with that property set.

这篇关于ListView控件在Android的“空白”区域的设置颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆