Android详解之ListView优化
去除ListView滑到顶部和底部时边缘的黑色阴影:
android:fadingEdge="none"
----------------------------------------------------
去除拖动时默认的黑色背景:
android:cacheColorHint="#00000000"
或
[java]
listView.setCacheColorHint(Color.TRANSPARENT);
----------------------------------------------------
去除选中时的黄色底色:
android:listSelector="#00000000"
或
[java]
listView.setSelector(new ColorDrawable(Color.TRANSPARENT));
---------------------------------------------------
去除行与行之间的黑线:
android:divider=" #00000000 "
或
listView.setDivider(null);
--------------------------------------------------
ListView刷新后自动滚到最底部:
[java]
listView.setSelection( listView .getAdapter().getCount()-1);
去掉滑动条:
[java]
android:scrollbars="none"
设置最小行高:
在item xml文件中根元素设置:android:minHeight="xxdip"
给listview添加addFootView:
[java]
View footView=getLayoutInflater().inflate(R.layout.footview, null);
listview.addFooterView(footView);
listview.setAdapter(adapter);
补充:移动开发 , Android ,