动画的z轴轮换意见与深度知觉之间的过渡 [英] animation to transition between views with rotation on z-axis with depth perception

查看:147
本文介绍了动画的z轴轮换意见与深度知觉之间的过渡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个动画两种观点,这两者都是ExpandableListViews之间进行转换。我想要的外观下面的图片中描述。

我试图用一个shrink_to_middle和grow_from_middle的输出/输入我的ViewAnimator的动画 - 和它的接近,但并不完全正确 - 我目前的收缩/成长,作为动画正在发生,双方的权利和左边缘的观点是相同的高度,这不提供任何深度到动画

我不知道如何最好地解释什么,我想,这就是为什么我画的形象,但在这里不用反正...我想有一个3-D的外观,其视图旋转的动画z轴。假设我们用一个简单的shrink_to_middle和grow_from_middle动画为出发点(不提供一个3-D的外观。)提供的3-D看,出来的动画将有右边缘得到逐渐变小的观点缩小到中间;的动画将具有左边缘获得逐渐增大作为视图的增长从中间

图片1到4将是出动画(用于查看#1)和图像5-8将是动画(用于查看#2)

在此先感谢。

修改: 仅供参考,这是我目前收缩到中间,从中间动画XML文件中成长

shrink_to_middle.xml

 < XML版本=1.0编码=UTF-8&GT?;
<设置的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android>
    <规模安卓插=@机器人:动画/ linear_interpolator
        机器人:fromXScale =1.0的Andr​​oid版本:toXScale =0.0的Andr​​oid版本:fromYScale =1.0
        机器人:toYScale =1.0的Andr​​oid版本:fillAfter =假机器人:时间=500/>
    <翻译机器人:fromXDelta =0安卓toXDelta =50%
        机器人:时间=500/>
< /集>
 

grow_from_middle.xml

 < XML版本=1.0编码=UTF-8&GT?;
<设置的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android>
    <规模安卓插=@机器人:动画/ linear_interpolator
        机器人:fromXScale =0.0的Andr​​oid版本:toXScale =1.0的Andr​​oid版本:fromYScale =1.0
        机器人:toYScale =1.0的Andr​​oid版本:fillAfter =假的android:startOffset =200
        机器人:时间=500/>
    <翻译机器人:fromXDelta =50%的Andr​​oid版本:toXDelta =0
        机器人:startOffset =200机器人:时间=500/>
< /集>
 

解决方案

Rotate3dAnimation就是答案。它是在样品SDK文件夹。我使用了0动画-90和90比0的动画,它的伟大工程。

I'm trying to create an animation to transition between two views, both of which are ExpandableListViews. The look I want is described in the image below.

I tried using a shrink_to_middle and grow_from_middle as the out/in animations of my ViewAnimator - and it's close, but not quite right - with my current shrink/grow, as the animation is taking place, both the right and left edges of the views are the same height, which does not provide any depth to the animation.

I'm not sure how best to explain what I want, which is why I drew the image, but here goes anyways... I want to have a 3-d look to the animation where the view is rotated on the z-axis. Assuming we use a simple shrink_to_middle and grow_from_middle animation as the starting point (which does not provide a 3-d look.) To provide the 3-d look, the out animation would have the right edge get progressively smaller as the view shrinks to the middle; the in animation would have the left edge get progressively larger as the view grows from the middle.

Images 1 through 4 would be the out animation (for view #1) and images 5-8 would be the in animation (for view #2)

Thanks in advance.

Edit: FYI, Here are my current shrink to middle and grow from middle animation xml files

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="1.0" android:fillAfter="false" android:duration="500" />
    <translate android:fromXDelta="0" android:toXDelta="50%"
        android:duration="500" />
</set>

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="1.0"
        android:toYScale="1.0" android:fillAfter="false" android:startOffset="200"
        android:duration="500" />
    <translate android:fromXDelta="50%" android:toXDelta="0"
        android:startOffset="200" android:duration="500" />
</set>

解决方案

Rotate3dAnimation is the answer. It is in the samples SDK folder. I'm using out animation of 0 to -90 and in animation of 90 to 0 and it works great.

这篇关于动画的z轴轮换意见与深度知觉之间的过渡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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