set animation on listview scrolling in android

后端 未结 5 1441
温柔的废话
温柔的废话 2021-01-01 08:20

I want to set an animation for a ListView for when a user scrolls the ListView. I am setting an animation for ListView when loading, b

5条回答
  •  粉色の甜心
    2021-01-01 08:55

    well first of all remove semicolon(;) from animation xml then I have see scroll animation like this app https://play.google.com/store/apps/details?id=com.nilstechsys.myquotes

    and this is a simple code of scroll animation in listview adpter

     Animation animation = null;
            animation = new TranslateAnimation(metrics_.widthPixels / 2, 0, 0, 0);
            //animation = AnimationUtils.loadAnimation(activity, R.anim.your_animation);
            animation.setDuration(400);
            convertView.startAnimation(animation);
            animation = null;
    

提交回复
热议问题