使用XML动画的android翻转动画:安卓 [英] Android: Flip Animation using XML for animation in android

查看:182
本文介绍了使用XML动画的android翻转动画:安卓的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关搜索网络上我发现,有ViewFlipper类,让在两个视图中的翻转观看动画/但应该是在同一个活动。我也知道,翻转动画不支载的活性变化。作为目前Android的支持仅在活动的变化2D动画。

For searching on net i found that there is ViewFlipper class that gives the Flip view animation between two view/ But for that should be in the same Activity. I also know that the Flip animation is not suported for the activity change. as right now android support only 2d animation during activity change.

我要的是厂名更改活动同样的效果。

I want is the make the same effect for changing the activity.

那么,有没有类似的,比如XML的动画,让效果就像翻阅显示,所以我提供给我的活动变化,并得到了活动改变这样的翻页效果。

So is there any similar like xml animation that gives effect as like FLip View so i provide that to my activity change and get the Such Flip effect for the Activity change.

请给我提供一些XML的动画,让翻转式动画THT适用于活动的变化。

Please provide me some xml for animation that gives the Flip type animation tht works for activity change.

感谢。

推荐答案

试试这个

overridePendingTransition(R.anim.grow_from_middle,R.anim.shrink_to_middle);

grow_from_middle.xml

grow_from_middle.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <scale
        android:interpolator="@android:anim/linear_interpolator"
        android:fromXScale="0.0"
        android:toXScale="1.0"
        android:fromYScale="0.7"
        android:toYScale="1.0"
        android:fillAfter="false"
        android:startOffset="200"
        android:duration="200" />
    <translate
        android:fromXDelta="50%"
        android:toXDelta="0"
        android:startOffset="200"
        android:duration="200"/>
</set>

shrink_to_middle.xml

shrink_to_middle.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <scale
        android:interpolator="@android:anim/linear_interpolator"
        android:fromXScale="1.0"
        android:toXScale="0.0"
        android:fromYScale="1.0"
        android:toYScale="0.7"
        android:fillAfter="false"
        android:duration="200" />
    <translate
        android:fromXDelta="0"
        android:toXDelta="50%"
        android:duration="200"/>
</set>

这篇关于使用XML动画的android翻转动画:安卓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆