修改listview fastscroll图像

来源:互联网 发布:pc蛋蛋软件 编辑:程序博客网 时间:2024/05/22 00:19
  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.icon);      f.set(o, drawable);  }  catch (Exception e)  {   throw new RuntimeException(e);  }


 

原创粉丝点击