android4.0上ListView出现残影
来源:互联网 发布:淘宝劵 编辑:程序博客网 时间:2024/05/01 23:58
先上图:
看到的那些选项实际上就是一张背景了,点不动了。下面是布局代码,这个在4.0之前的版本没有问题,但是4.0上ListView就容易出现残影(上次另一种布局也出现了)。
配置文件是:
<ListView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:cacheColorHint="@color/transparentColor" android:background="@color/textColorWhite" android:divider="@drawable/bg_list_divider" android:fastScrollEnabled="true" android:descendantFocusability="afterDescendants" android:listSelector="@drawable/rc_list_selector_bg"/> <RelativeLayout android:id="@+id/no_contact_indication" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/bgColorMain" android:fillViewport="true" android:gravity="center"> <TextView android:id="@+id/emptyListText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@color/bgColorMain" android:fillViewport="true" android:gravity="center" android:singleLine="true" android:text="@string/noContacts" android:textColor="@color/textColorGray" android:textSize="20sp" /> <ProgressBar android:id="@+id/loading" style="@style/RCMProgressBar" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" /> </RelativeLayout>
解决方法就是把TextView的
android:layout_height="fill_parent"
这样改了。就OK了。
或者是把RelativeLayout的
android:layout_height="fill_parent"
改成
android:layout_height="0dp" android:layout_weight="1"
(坑爹的是这样改在我的模拟器上第一次进程序搜索没有匹配项时不会显示提示信息。切换一下就又显示了,以为是什么奇怪的问题。结果在两部真机上试了都没问题。。。对应android版本一致)
不知道出现这些问题跟 runQueryOnBackgroundThread 方法有没有关系。搜索时是进入这个方法的。感觉这个方法的机制写的是不是有点问题,怎么总是出现莫名奇妙的界面问题。
- android4.0上ListView出现残影
- ListView滑动出现残影
- android4.0 上定制状态栏
- 在Ubuntu14.04上编译Android4.0.1出现的几个问题
- 在Ubuntu14.04上编译Android4.0.1出现的几个问题
- F14编译android4.0出现的问题
- 编译android4.0出现jdk版本问题
- 一个页面上出现多个listView
- android2.x的桌面项目程序在android4.0上运行后出现 java.lang.NoClassDefFoundError错误 解决方法
- Android4.0上合并apk和odex
- BeagleBoard上android4.0系统移植
- Android4.0上添加截屏快捷方式
- Android4.0上添加截屏快捷方式
- android4.0上状态栏上加入虚拟按键
- ScrollView嵌套ListView会出现的ListView底部会自动出现在屏幕上
- Android_ScrollView嵌套ListView会出现的ListView底部会自动出现在屏幕上
- Android4.1上出现java.lang.IllegalArgumentException: pointerIndex out of range
- android4.1+ ListView 不滚动
- oracle中的connect by prior ... start with 数据库的递归算法
- glibc ptmalloc中的宏操作
- 截断表 TRUNCATE
- “IT程序猿是怎么练成的” ——浅阅读是个技术活:食不厌精,脍不厌细
- JavaScript【日期(今天是:xxxx年xx月xx日)】
- android4.0上ListView出现残影
- cocos2d-x场景动态切换
- MongoDB Sharding配置
- 指尖上的代码[C语言版]-<7>数据结构之单链表
- 线索二叉树
- JavaScript【省市级联】
- atexit
- Java代码混淆
- cocos2dx创建线程