ObjectAnimator animate LinearLayout width

后端 未结 5 1243
日久生厌
日久生厌 2020-11-30 20:31

Ok, so i checked out http://android-developers.blogspot.com/2011/02/animation-in-honeycomb.html

He says you can animate the property of an object in a given time. A

5条回答
  •  有刺的猬
    2020-11-30 20:54

    I've created a small library ViewPropertyObjectAnimator that can do that in a very simple way (and uses a similar approach to this proposed by Tomer Weller).

    You could achieve this animation with (assuming the mLinearLayout is the animated View and mEndWidth is the end value of the View's width):

    ViewPropertyObjectAnimator.animate(mLinearLayout).width(mEndWidth).start();
    

提交回复
热议问题