Using ObjectAnimatorObjectAnimator is a powerful animation framework introduced in Android 3.0, which is used to animate the properties of any object. You can use ObjectAnimator to change the translationX and translationY properties of a View to implement the translation animation of a View. Using ValueAnimatorValueAnimator is a lower-level animation framework that generates a series of values during the animation process and then uses these values to update the properties of the View. For translation animation, update the translationX and translationY properties of the View by listening to the value changes of ValueAnimator. Using ViewPropertyAnimatorStarting from Android 3.0, the View class provides an animate() method that returns a ViewPropertyAnimator object that can be used to chain multiple animation methods. Using XML AnimationAnimations can be defined in XML files and loaded and applied when needed. Note: When using the startAnimation() method, the position of the View will be reset to its original position after the animation ends, unless you manually update the position of the View at the end of the animation. If you want the View to remain in its final position after the animation ends, consider using the ObjectAnimator, ValueAnimator, or ViewPropertyAnimator methods mentioned above. Using drawBitmapDraw pictures at different positions through drawBitmap, which is suitable for the need of using pictures as translation animation. |
<<: Several methods to implement delayed operation in Android development
>>: iOS 18 new features only support iPhone 15 Pro and above!
In the early days of the Vietnam War, many Americ...
Meizu, which releases new phones at a rapid pace,...
In the eyes of many people, artificial intelligen...
In the book "The increasing amount of space ...
[51CTO.com original article] The protagonist of t...
WeChat was officially released on January 21, 201...
There are so many seasonal fruits in autumn, but ...
Compared with traditional cooking methods, some o...
Eating mushrooms daily may reduce depression and ...
The advantages of WeChat mini program investment ...
Haikou Machinery Equipment Mini Program investmen...
Every year there are always a number of brainwash...
Recently, many people have asked me a question, h...
【WeChat circle points system】 WeChat circle point...
BMI has long been the most commonly used indicato...