开发者

When I scroll the ListView, the background image is not displayed. Why?

开发者 https://www.devze.com 2023-03-03 05:22 出处:网络
I have one custom ListView which contains one ImageView and one TextView, and I set a background. But while I am scrolling the ListView, the background image is n开发者_如何学编程ot displayed. How can

I have one custom ListView which contains one ImageView and one TextView, and I set a background. But while I am scrolling the ListView, the background image is n开发者_如何学编程ot displayed. How can I fix this?

Black color is display.


Set the following property in your ListView in the layout file.

  android:cacheColorHint="#00000000"

That will make it so that when you scroll the background image shows up correctly.


Use this: listview.setCacheColorHint(0);

0

精彩评论

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