改变渐变色的ListView时结束 [英] change gradient colour at end of ListView

查看:82
本文介绍了改变渐变色的ListView时结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在谷歌Nexus S,当一个人试图拖过去ListView的结束,一个黄色的渐变出现,其大小由拖动的距离决定。怎样才能改变这种渐变的颜色?我什么都看不到明显的。

On the Google Nexus S, when one tries to drag past the end of a ListView, a yellow gradient appears, and its size is determined by the distance dragged. How does one change the colour of this gradient? I cannot see anything obvious.

这是不可以 cacheColorHint。

It is not cacheColorHint.

推荐答案

这似乎是硬codeD中的滚动型实施。看一看<一href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/ScrollView.java;;hb=HEAD"相对=nofollow>这个,上线1389的 setOverScrollMode()办法(确切的行号可能,如果有人更新源改变):

It appears to be hard-coded in the ScrollView implementation. Have a look at this, the setOverScrollMode() method on line 1389 (the exact line number may change if someone updates the source):

@Override
 public void setOverScrollMode(int mode) {
     if (mode != OVER_SCROLL_NEVER) {
         if (mEdgeGlowTop == null) {
             final Resources res = getContext().getResources();
             final Drawable edge = res.getDrawable(R.drawable.overscroll_edge);
             final Drawable glow = res.getDrawable(R.drawable.overscroll_glow);
             mEdgeGlowTop = new EdgeGlow(edge, glow);
             mEdgeGlowBottom = new EdgeGlow(edge, glow);
         }
     } else {
         mEdgeGlowTop = null;
         mEdgeGlowBottom = null;
     }
     super.setOverScrollMode(mode);
 }

这是我能看到的唯一方法是定义你自己的滚动型的实现,覆盖 setOverScrollMode()来使用自己的可绘,然后implent自己的的ListView 将使用标准一滚动型的,而不是实施

The only way that I can see is to define your own ScrollView implementation, override setOverScrollMode() to use your own drawables, and then implent your own ListView which will use your ScrollView implementation instead of the standard one.

这篇关于改变渐变色的ListView时结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆