2

In Android 2.3.x (and maybe previous versions?) when working with any scrollable Views, like a ListView or ScrollLayout, etc, when you reach the top or bottom of the list, a orange gradient appears to indicate that you are at the top or bottom of the list and can't scroll any farther. The gradient gets bigger as you try to scroll farther off the screen. I don't know what the name is of this type of widget in the SDK.

Anyways, how to do I alter it, change colors, get rid of it, etc?

Orange Gradient

2 Answers 2

2

ListView.setOverscrollHeader(Drawable drawable);

ListView.setOverscrollFooter(Drawable drawable);

1
  • FYI: Those were added in API lvl 9, Android 2.3 and I was so hopeful for this solution.
    – varikin
    Sep 29, 2011 at 22:18
0

Have a look at this

change gradient colour at end of ListView

Override setOverScrollMode method

@Override  public void setOverScrollMode(int mode) {
     if (mode != OVER_SCROLL_NEVER) {
         if (mEdgeGlowTop == null) {
             final Resources res = getContext().getResources();
             final Drawable edge = res.getDrawable(R.drawable.overscroll_edge);
             final Drawable glow = res.getDrawable(R.drawable.overscroll_glow);
             mEdgeGlowTop = new EdgeGlow(edge, glow);
             mEdgeGlowBottom = new EdgeGlow(edge, glow);
         }
     } else {
         mEdgeGlowTop = null;
         mEdgeGlowBottom = null;
     }
     super.setOverScrollMode(mode);  }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.