这是一个解决方法,对我有用:
http://evendanan.net/android/branding/2013/12/09/branding-edge-effect/
public static void brandGlowEffect(Context context, int brandColor) {
//glow
int glowDrawableId = context.getResources().getIdentifier("overscroll_glow", "drawable", "android");
Drawable androidGlow = context.getResources().getDrawable(glowDrawableId);
androidGlow.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN);
//edge
int edgeDrawableId = context.getResources().getIdentifier("overscroll_edge", "drawable", "android");
Drawable androidEdge = context.getResources().getDrawable(edgeDrawableId);
androidEdge.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN);
}
您必须在设置布局后立即在 OnCreate 调用此方法。