如图。我的XML文件如下:<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" > <ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@android:id/list"
android:cacheColorHint="#00000000"
android:fadingEdge="none"
></ListView>
</RelativeLayout>
android:cacheColorHint="#00000000"
/>
加上这个,00000000,前2位代表透明度,后六位是颜色,如果你的listView背景是白的,就用白色(00FFFFFF),自己调下
android:fadingEdge="none"这个属性是listView一边缘有个模糊效果。
我这个是拉到顶部或底部的时候的一个拉伸效果。两个是不一样的。
在这个类里面:android.widget.AbsListView,有两个成员变量,mEdgeGlowTop和mEdgeGlowBottom,它们就是代表顶部和底部的拉伸的效果。我们可以用反射的形式,将它们设置为null。
Class<?> c = (Class<?>) Class.forName(m_className);
Field acEdgeGlowTop = c.getDeclaredField("mEdgeGlowTop");
Field acEdgeGlowBottom = c.getDeclaredField("mEdgeGlowBottom");
acEdgeGlowTop.set(listView, null);
acEdgeGlowBottom.set(listView, null);
我以前尝试过更改这个颜色,系统默认是黄色(3.0以下),我通过反射改为另外的形式,所以,我觉得把他们设置为null,应该就可以去掉。会不会出异常,我没有试过。楼出可以尝试一下。
http://blog.csdn.net/svrsimon/article/details/7200332