Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了android – 缩小两个活动之间的过渡动​​画大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我检查了API代码附带的过渡动画,我找到了动画zoom_enter和zoom_exit,其中活动1下沉IN以显示活动2.我需要反过来.我需要活动2从内部缩小并进入顶部. (我希望你能得到我).这种类型的动画在 iphone屏幕转换时是相同的.

下面的代码是我不需要的效果.
这是zoom_enter.xml的代码

<set xmlns:android="http://scheR_980_11845@as.android.com/apk/res/android"
    android:interpolator="@android:anim/decelerate_interpolator">
    <scale android:fromXScale="2.0" android:toXScale="1.0"
       android:fromYScale="2.0" android:toYScale="1.0"
       android:pivotX="50%p" android:pivotY="50%p"
       android:duration="@android:Integer/config_mediumAnimTime" />
</set>

这是zoom_exit.xml的代码

<set xmlns:android="http://scheR_980_11845@as.android.com/apk/res/android"
    android:interpolator="@android:anim/decelerate_interpolator"
    android:zAdjustment="top">
    <scale android:fromXScale="1.0" android:toXScale=".5"
       android:fromYScale="1.0" android:toYScale=".5"
       android:pivotX="50%p" android:pivotY="50%p"
       android:duration="@android:Integer/config_mediumAnimTime" />
    <alpha android:fromAlpha="1.0" android:toAlpha="0"
        android:duration="@android:Integer/config_mediumAnimTime"/>
</set>

然后在startActivity之后我调用下面的方法

overridePendingTransition(R.anim.zoom_enter,R.anim.zoom_exit);

任何人都可以建议我如何更改上述文件,以解释我的屏幕转换?

@H_450_25@解决方法
在zoom_enter.xml中尝试此操作,并从zoom_exit.xml中删除动画.你会看到更好的效果.

<set xmlns:android="http://scheR_980_11845@as.android.com/apk/res/android"
    android:interpolator="@android:anim/decelerate_interpolator">
    <scale android:fromXScale="0.0" android:toXScale="1.0"
       android:fromYScale="0.0" android:toYScale="1.0"
       android:pivotX="50%p" android:pivotY="50%p"
       android:duration="@android:Integer/config_mediumAnimTime" />
</set>

希望这可以帮助.

大佬总结

以上是大佬教程为你收集整理的android – 缩小两个活动之间的过渡动​​画全部内容,希望文章能够帮你解决android – 缩小两个活动之间的过渡动​​画所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。