标签:android style class c get a
首先把布局文件中李斯特view添加android:fastScrollEnabled="true";
然后代码中添加代码:
private void setScrollBar()
{
try
{
Field f = AbsListView.class.getDeclaredField("mFastScroller");
f.setAccessible(true);
Object o = f.get(listview);
f = f.getType().getDeclaredField("mThumbDrawable");
f.setAccessible(true);
Drawable drawable = (Drawable) f.get(o);
drawable = getResources().getDrawable(R.drawable.ic_launcher);
f.set(o, drawable);
} catch (Exception e)
{
throw new RuntimeException(e);
}
}
修改listview默认的滑动条,布布扣,bubuko.com
标签:android style class c get a
原文地址:http://blog.csdn.net/dianqiugg/article/details/25713647