码迷,mamicode.com
首页 > 移动开发 > 详细

【Android】解决Android的ListView控件滚动时背景变黑

时间:2015-06-19 10:09:42      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:

如果大家在非黑色背景下使用ListView控件时,Android默认可能在滚动ListView时这个列表控件的背景突然变成黑色。这样可能导致程序的黑色的背景和主程序的主题既不协调。解决的方法Google在设计Android时也考虑了,在Layout的ListView中加入android:cacheColorHint="#00000000" 的属性即可。

如:

 
<?xml version="1.0" encoding="utf-8"?>
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/comList"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/white"
   android:cacheColorHint="#00000000" >

</ListView>
 

【Android】解决Android的ListView控件滚动时背景变黑

标签:

原文地址:http://www.cnblogs.com/xubuhang/p/4587760.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!