首页 > 移动平台 > 详细

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

时间:2015-06-19 10:06:59      阅读:276      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!