Detailed example of tweeted animation in Android

Detailed example of tweeted animation in Android

There are four types of tweened animation. The following mainly introduces the scale type.

The operation effect is as follows:

The Android SDK provides two methods: directly reading animation from XML resources and initializing the animation object with the constructor of the animation subclass. The second method knows how to use it after reading the descriptions of various classes in the Android SDK. The following is a brief description of reading animation from XML resources. The content of the animation file animation.xml in the XML resource is:

The contents of the main file scaleanimation.java are:

The program is easy to understand, mainly to illustrate the effect of telescopic animation without increasing complexity. It is worth noting that in the test phase, I mistakenly thought that the layout file was not needed, and put the line setcontentview (r.layout. Main); Remove, causing the program to run error all the time. In fact, animation also needs to first load the layout file into the activity, and then add animation to the controls in the layout.

If you have any questions, please leave a message or go to the community of this site for exchange and discussion. Thank you for reading. I hope it can help you. Thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>