2013-04-24 26 views
2

当我们尝试在列表视图中的顶部(或结尾)拉动时,我确实想要改变蓝色闪耀的颜色(蓝色突出显示)在那里的项目)。Android:在列表视图中更改蓝色闪耀(蓝色突出显示)的颜色

因此,我想将这种颜色从蓝色变为橙色,伙计们。

http://img835.imageshack.us/img835/5609/28746577.jpg

P/S:

  • 我知道蓝色是默认的。 (来自ICS以上)
  • 我添加图片显示,黄色矩形是位置出现蓝色光芒(或蓝色高亮)
  • 在Android 2.3.6(HTC Device)上,默认颜色是橙色。我知道该蓝色是默认的。 (从ICS上文)

谢谢,

+0

向我们展示您的代码.. – 2013-04-24 05:20:15

+0

您知道我说得清楚吗?如果你知道,你可以给我更详细的给你我的代码?我真的不知道你需要哪个代码。 – 2013-04-24 06:17:30

回答

0

它不能这样做。在这里你会找到一个解释:

https://groups.google.com/forum/?fromgroups=#!topic/android-developers/i5a3uNN8jpg

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中或OnCreateView调用此方法。

2

这里有一个解决方案,为我工作:

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中调用该方法,设置布局之后。

相关问题