间隔变色
Adapter中添加colors数组
private int[] colors = new int[] {getResources().getColor(R.color.item_dark),
getResources().getColor(R.color.item_light)};
getView中添加
int colorPos = position % colors.length;
convertView.setBackgroundColor(colors[colorPos]);
高亮显示(模糊查询)
getView中添加
if (null != str && str.contains(key)) {
int index = str.indexOf(key);
int len = key.length();
Spanned temp = Html.fromHtml(str.substring(0, index)
+ "<font color=#ffffff>"
+ str.substring(index, index + len) + "</font>"
+ str.substring(index + len, str.length()));
mHolder.mTextNumber.setText(temp);
} else {
mHolder.mTextNumber.setText(bean.getStrNumber());
}
滚动条样式
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/b9208a1ce5c4495d917b48b1042b4630.png)
布局文件ListView中添加
android:scrollbarStyle="outsideInset"
扩展(其他样式)
有张图片一目了然