0

I'm now trying to make a ListView with a fast scroll on it. And I made a custom fast scroll thumb with the code following:

    try {
        Field f = AbsListView.class.getDeclaredField("mFastScroller");
        f.setAccessible(true);

        Object o = f.get(listview);
        f = f.getType().getDeclaredField("mThumbImage");

        f.setAccessible(true);
        ImageView iv = (ImageView) f.get(o);

        iv.setImageDrawable(drawable);

        // Drawable drawable = (Drawable) f.get(o);
        // drawable =
        // getResources().getDrawable(R.drawable.scroll_selector);
        // f.set(o, drawable);

        return true;
    } catch (Exception e) {
        e.printStackTrace();
    }
    return false;

Although it shows image perfectly, it has an invisible area that occupies too much part of ListView row. Can anyone give me a suggestion what I should do right now? I want the scroll to be placed at the end of the right edge..

Jun
  • 11
  • 3

0 Answers0