How can I change the OverScroll color in Android 2.3.1?

后端 未结 3 1601
一整个雨季
一整个雨季 2020-11-30 23:33

Since Android 2.3.1 there is a new feature for ScrollViews and Lists called OverScroll. With

android:overScrollMode=\"never\"

I can turn i

3条回答
  •  一个人的身影
    2020-12-01 00:13

    Actually, instead of using a customized ListView, you can simply "hack" your way to changing the color, the glow effect is actually a Drawable embedded in the OS's resources, you can apply a ColorFilter on that:

    int glowDrawableId = context.getResources().getIdentifier("overscroll_glow", "drawable", "android");
    Drawable androidGlow = context.getResources().getDrawable(glowDrawableId);
    androidGlow.setColorFilter(brandColor, PorterDuff.Mode.MULTIPLY);
    

    Read more about it here: http://evendanan.net/android/branding/2013/12/09/branding-edge-effect/

提交回复
热议问题