有没有一种方法来禁用的Andr​​oid的ListView动画? [英] Is there a way to disable Android ListView animation?

查看:95
本文介绍了有没有一种方法来禁用的Andr​​oid的ListView动画?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们拖动的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

这篇关于有没有一种方法来禁用的Andr​​oid的ListView动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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