View animation right to left android

前端 未结 3 1939
隐瞒了意图╮
隐瞒了意图╮ 2020-12-13 01:20

I am not able to put view animation for inflated layouts. I used the following code snippet

pageView.startAnimation(AnimationUtils.loadAnimation(this,R.anim.         


        
3条回答
  •  难免孤独
    2020-12-13 01:45

    If you're trying to animate the view when it's first created, then you either need to set the layoutAnimation XML property or call setLayoutAnimation().

    If you just want to make your view look like it's moving, you need a TranslateAnimation; see this answer: https://stackoverflow.com/a/4214490/832776 Also if you'd like to repeat the animation, then call setAnimationListener() and in onAnimationEnd() just start the animation again.

    If you're trying to move the view permanently, see this: http://www.clingmarks.com/how-to-permanently-move-view-with-animation-effect-in-android/400

提交回复
热议问题