【问题标题】:How to animate listview to show one by one?如何为列表视图设置动画以一一显示?
【发布时间】:2016-01-28 06:30:43
【问题描述】:

我有代码可以为列表视图设置动画,但我不知道如何将该代码更改为一个一个显示列表。

  float initialTranslation = (mLastPosition <= position ? 500f : -500f);
          convertView.setTranslationY(initialTranslation);

      convertView.animate()
              .setInterpolator(new DecelerateInterpolator(1.0f))
              .translationY(0f)
              .setDuration(500l)
              .setListener(null);

      // Keep track of the last position we loaded
      mLastPosition = position;

【问题讨论】:

    标签: android eclipse android-animation


    【解决方案1】:

    我使用图书馆:

    https://github.com/nhaarman/ListViewAnimations

    用于列表视图动画。它就像一个魅力

    库说明:-

    ListViewAnimations 是一个开源 Android 库,允许开发人员轻松创建带有动画的 ListView。只要您引用此项目并在您的应用中包含许可证,您就可以在您的 Android 应用中随意使用它。

    这里是库演示链接:

    https://play.google.com/store/apps/details?id=com.haarman.listviewanimations

    你也可以使用新的 recyclerView,它为添加、删除项目提供内置动画

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-15
      • 1970-01-01
      • 1970-01-01
      • 2019-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多