setVerticalScrollBarEnabled(false) android
2.白色的背景,ListView滚屏进行中的时候,背景会变成黑色,解决办法? 布局
android:cacheColorHint="#00000000" spa
3.ListView滚动条怎么一直都显示? 事件
android:fadeScrollbars="false" 图片
4.ListView隔行变色: ci
int[] colors={Color.BLUE,Color.CYAN}; get
convertView.setBackgroundColor(colors[position%2]); it
5.ListView中嵌套了checkbox,焦点会到checkbox身上,解决办法 io
holder.checkBox.setFocusable(false); List
6.listView滚动轴图片更改?
android:scrollbarThumbHorizontal="" //滚动轴游标
android:scrollbarTrackVertical="" //滚动轴背景、
引用的是9patch图片
7.ListView设置EmptyView?
mListView.serEmptyView();
Sets the view to show if the adapter is empty这个就是对此方法的描述
当listview的adapter为null的时候,就会显示所设置的view。
须要注意的有两点:在调用setAdapter()以前调这个方法;设置的emptyview必须放在listview的直接父布局里,
好比说listview嵌在一个LinearLayout里面的话,须要在代码里面写
mLinearLayout.addContentView(你的emptyview);
不然的话是没效果的。
8.ListView设置FooterView?
在调用setAdapter()以前调这个方法
footerView能够单独写点击触发事件,可是注意最好写在listview的OnItemClickListener()里面,而后根据点击
的位置if(position == mListView.getCount - 1){"触发footerview点击事件"}
若是是单独给它一个View.onClickListener的话,点击是能够触发事件的,可是没有listview的item按下的变黄色效果。