今天开发时碰到一个问题,我的listview有背景图片,但当点击listview下方的空白区域时,listview中的item背景变成了黑色.

我还以为是android的一个bug,但上google上搜了一下,在下面的文章中找到了答案.

http://android-developers.blogspot.com/2009/01/why-is-my-list-black-android.html

This technique is used throughout the system to indicate that the container can be scrolled.

This rendering issue is caused by an optimization of the Android framework enabled by default on all instances of ListView.

不过文中也提出了解决方法,设置一下listview的xml属性就可以解决了.
android:cacheColorHint="#00000000"

当然,原文作者也承认,这样的作法给开发者带来了不便.

更多相关文章

  1. ionic4项目结合chrome在Android真机运行调试
  2. 为开发者准备的最佳 Android(安卓)函数库(2016年版)
  3. Android开发者指南(2) —— aapt
  4. android开发大牛博客
  5. 原著阅读 - Android(安卓)Programming The Big Nerd Ranch Guide
  6. [置顶] Android开发者社区
  7. Android(安卓)Studio 奇技淫巧
  8. Android(安卓)M 新的运行时权限开发者需要知道的一切 (安卓6.0新
  9. Android(安卓)定时重复启动弹出窗口。

随机推荐

  1. 另类观点:Android平板制造商应该选择亚马
  2. cocos2dx通过Jni调用Android的Java层代码
  3. 谷歌 Android 3.0计划四季度推出:代号姜饼
  4. android四大组件--android service详解
  5. Singletons vs. Application Context in
  6. [置顶] [Android基础]Android的消息机制
  7. 腾讯暑假实习面试总结
  8. android修改虚拟内存(方法)
  9. android 借助AccessibilityService实现模
  10. 阿里Android开发规范:四大基本组件