修改listview fastscroll图像

  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);
  }


 

你可能感兴趣的:(Android)