有没有一种方法来禁用的Andr​​oid的ListView动画?方法来、动画、oid、Andr

由网友(你敢放弃LOL去爱她?)分享简介:当我们拖动的ListView 来结束或者顶端,我们总是可以再稍微拖动它,它会显示一个空的背景,那么当我们释放在的ListView 将反弹。这是一个默认的动画效果的ListView 。When we drag a ListView to the end or to the top, we can always drag...

当我们拖动的ListView 来结束或者顶端,我们总是可以再稍微拖动它,它会显示一个空的背景,那么当我们释放在的ListView 将反弹。这是一个默认的动画效果的ListView

When we drag a ListView to the end or to the top, we can always drag it a little further and it will show a blank background, then when we release it the ListView will bounce back. It's a default animation effect of ListView.

我想禁用此动画效果。

推荐答案

这可能工作。创建一个包含以下内容的新类。

This may work. Create a new class that contains the following.

import android.view.View;

public class OverScrollDisabler
{
    public static void disableOverScroll(View view)
    {
        view.setOverScrollMode(View.OVER_SCROLL_NEVER);
    }
}

然后在你的code,

Then within your code,

if(Build.VERSION.SDK_INT >= 9)
{
    OverScrollDisabler.disableOverScroll(myView);
}

更多细节在这里: http://jasonfry.co.uk/?id=30

阅读全文

相关推荐

最新文章