2013-04-24 68 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中調用該方法,設置佈局之後。

相關問題