【问题标题】:Android-Change scroll animation as acceleration decelerationAndroid-将滚动动画改成加速减速
【发布时间】:2015-11-09 12:37:52
【问题描述】:

我已经实现了 listView。当我以编程方式滚动时,它的滚动动画非常快。我希望滚动动画以我提供的最大速度(和/或持续时间)加速然后减速。

【问题讨论】:

    标签: android listview animation scroll acceleration


    【解决方案1】:

    你可以使用这个库:https://github.com/daimajia/AnimationEasingFunctions

    例如:

        AnimatorSet animation = new AnimatorSet();
        animation.playTogether(Glider.glide(Skill.CubicEaseInOut, 500f, ObjectAnimator.ofInt(listView, "scrollY", itemView.getTop())));
        animation.setDuration(500);
        animation.start();
    

    其中Skill.CubicEaseInOut 是根据http://easings.net/ 的动画类型

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-08-01
      • 2013-03-13
      • 1970-01-01
      • 2019-01-16
      • 1970-01-01
      • 2011-07-06
      • 2017-01-18
      相关资源
      最近更新 更多