Now, let's take a look at the use of scale (scaling):
Calling method: Overridependingtransition (r.anim.scale_in, r.anim.scale_out);
R.ANIM.SCALE_IN represents the XML file to enter the activity interface, R.anim.scale_out represents the left activity interface XML file, in the XML file can be configured related properties, you can achieve the relevant animation effect.
Here is an example of what the configuration means:
R.anim.scale_in:
<?xml version= "1.0" encoding= "Utf-8"?>
<set xmlns:android= "Http://schemas.android.com/apk/res/android" >
<scale
android:duration= "4000"
Android:fromxscale= "1.0"
android:fromyscale= "0.0"
android:pivotx= "0%p"
Android:pivoty= "0%p"
Android:toxscale= "1.0"
Android:toyscale= "1.0"/>
</set>
<!--
Duration: Experience time of 4000ms
The Fromyscale is enlarged from 0.0 to 1.0;
Fromxscale not change
Pivotx and Pivoty: Enter the position of the screen 0%p means from the top, 100% means to start from the bottom of the screen to enter-
R.anim.scale_out:
<?xml version= "1.0" encoding= "Utf-8"?>
<set xmlns:android= "Http://schemas.android.com/apk/res/android" >
<scale
android:duration= "4000"
Android:fromxscale= "1.0"
Android:fromyscale= "1.0"
android:pivotx= "100%p"
Android:pivoty= "100%p"
Android:toxscale= "1.0"
android:toyscale= "0.0"/>
</set>
The relevant configuration information is consistent with the r.anim.scale_in meaning.
Next Rotate_scale (Rotating interface)
Calling method: Overridependingtransition (r.anim.alpha_in, R.anim.rotate_scale);
R.anim.rotate_scale is the XML file that we need to configure for the rotation interface
<?xml version= "1.0" encoding= "Utf-8"?>
<set xmlns:android= "Http://schemas.android.com/apk/res/android" >
<rotate
android:duration= "4000"
android:fromdegrees= "0"
Android:interpolator= "@android: Anim/linear_interpolator"
android:pivotx= "50%p"
Android:pivoty= "50%p"
android:startoffset= "0"
android:todegrees= "720"
android:toyscale= "0"/>
<scale
android:duration= "4000"
Android:fromxscale= "1.0"
Android:fromyscale= "1.0"
android:pivotx= "50%p"
Android:pivoty= "50%p"
android:toxscale= "0.0"
android:toyscale= "0.0"/>
</set>
<!--
<rotate> Tags: rotation, this article is configured to indicate that the rotation time is 4000ms, the center of rotation is the positive center, determined by the attribute android:pivotx= "50%" and android:pivoty= "50%".
Android:fromdegrees: The degree at which the rotation starts
Android:todegrees: The degree at the end.
<scale> Tags: zoom: Zoom time is 4000ms, center of scale is centered, attribute android:pivotx= "50%p"
Android:pivoty= "50%p" determines that scaling is scaled from 1.0 to 0.0, which is reduced from the original size to 0 size
-
This article is from the "Month ~ Night" blog, please make sure to keep this source http://zy19920214.blog.51cto.com/9704177/1686220
The scale and Routate_scale use of the Android interface conversion effect template