Android - Change left margin using animation

后端 未结 4 990
别那么骄傲
别那么骄傲 2020-12-07 18:25

I am changing the left margin of an image view in the following manner :

ViewGroup.MarginLayoutParams layoutParams =         


        
4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-07 18:56

    You can use the following

    image.animate().setDuration(durationIn).translationXBy(offsetFloat).start();
    

    You can also add .setInterpolator(new BounceInterpolator()) to change the look of the animation.

提交回复
热议问题