I have a small problem with my scroll view. Whenever a scroll view has over scrolled, it shows a yellow gradient (in my device, it may vary for other devices) at edges of scroll view. It can be eliminated by setting attribute as below in android 2.3 and above.
android:overScrollMode="never"
Now i want to change the default color to some other. How to achieve this.
Please help me regarding this. Any help will be appreciated.
You should use the following attributes on your ListView
:
<ListView
...
android:overScrollHeader="@drawable/header"
android:overScrollFooter="@drawable/footer"/>
You could also set them programatically using setOverscrollFooter(Drawable d)
and setOverscrollHeader(Drawable d)
.
This EdgeEffectOverride library works nicely for all scroll-type views: https://github.com/AndroidAlliance/EdgeEffectOverride
E.g.
<uk.co.androidalliance.edgeeffectoverride.EdgeEffectScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
...
app:edgeeffect_color="@color/red"
/>
And
EdgeEffectScrollView gridView = (EdgeEffectScrollView) root.findViewById(R.id.myscroll);
gridView.setEdgeEffectColor(Color.RED);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With