自定义ListView FastScroller滑块图片
使用ListView FastScroller,默认滑块和自定义滑块图片的样子: 设置快速滚动属性很容易,只需在布局的xml文件里设置属性即可: <ListView android:id="@+id/listView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fastScrollEnabled="true" android:focusable="true" /> 但是有时候会发现设置属性无效,滚动ListView并未出现滑块。原因是该属性生效有最小记录限制。当ListView记录能够在4屏以内显示(也就是说滚动4页)就不会出现滑块。可能是api设计者认为这么少的记录不需要快速滚动。 我的依据是android源代码,见FastScroller的常量声明: // Minimum number of pages to justify showing a fast scroll thumb private static int MIN_PAGES = 4; 日志引用ListView快速滚动示例增加首字母提示 发送文章为PDF