Android的ListView控件不被粉刷上滚动 [英] Android ListView not being repainted on scroll
问题描述
这是最好的图片说明。在我的的ListView滚动前
,一切都看起来不错:
This is best described with pictures. Before scrolling in my ListView
, everything looks fine:
滚动之后:
这可能是导致这个古怪的行为?我正在测试它的谷歌Nexus 运行的Android 4.2.2 并已经尝试过在模拟器上运行的 Android 3.2的具有相同的结果。在这个例子中,我使用的是的ListView
有两种类型的行,但我得到一个标准相同的结果的ListView
只有一个行类型。
What could be causing this odd behavior? I am testing it on a Google Nexus running Android 4.2.2 and have tried it on the emulator running Android 3.2 with the same result. In this example I am using a ListView
with two types of rows, but I get the same result with a standard ListView
with just one row type.
推荐答案
原来,问题是,我并没有设定我的布局XML文件中的背景色......如果有人能向我解释为什么这能解决问题,我将不胜AP preciate它。添加
机器人:背景=#000000到我的主要布局固定它,虽然
It turns out the problem was that I did not set a background color in my layout XML file... If someone could explain to me why this fixes the problem, I would greatly appreciate it. Adding android:background="#000000" to my main layout fixed it, though.
...
这篇关于Android的ListView控件不被粉刷上滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!