android - 如何使 ListView 动画化以逐一显示?

标签 android eclipse android-animation

我有为 ListView 设置动画的代码,但我不知道如何将代码更改为一个一个地显示列表。

  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;

最佳答案

我使用图书馆:

https://github.com/nhaarman/ListViewAnimations

用于 ListView 动画。它就像一个魅力

库描述:-

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

这是库演示链接:

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

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

关于android - 如何使 ListView 动画化以逐一显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35054299/

相关文章:

Android fragment 退出动画不触发

java - setimage alapha 在 android 5.1 中不起作用

java - "Error type 3 Error: Activity class {} does not exist",启动 Activity 时错误类型 3 Activity 类不存在

java - Zxing 库实现 : And the below part on getting back the result after the scanning Activity gives an error

python - 从代码中的一个点跟踪所有语句

android - 如何像进度条一样填充imageview的背景色?

android - 使用动态大小将 div 对齐到页面中心

java - Eclipse/Hibernate 工具错误 : Archive classpath entry doesn't exist

eclipse - Eclipse 的 Youtrack 插件?

android - 使用 Picasso 在 Activity 之间共享过渡