Android property animation: how to increase view height?

后端 未结 7 2206
不知归路
不知归路 2020-12-07 20:17

How to increase the view height using Property Animations in Android?

ObjectAnimator a = ObjectAnimator.ofFloat(viewToIncreaseHeight, \"translationY\", -100)         


        
7条回答
  •  感动是毒
    2020-12-07 20:50

    You can use ViewPropertyAnimator, which can save you some lines of code :

    yourView.animate()
       .scaleY(-100f)
       .setInterpolator(new AccelerateDecelerateInterpolator())
       .setDuration(1000);
    

    that should be all you need, be sure to check the documentation and all available methods for ViewPropertyAnimator.

提交回复
热议问题