片段,安卓:zAdjustment(Z顺序)和动画 [英] fragments, android:zAdjustment (z order) and animations

查看:916
本文介绍了片段,安卓:zAdjustment(Z顺序)和动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的支持库。现在,我想有一个片段从底部转移,动过的previous之一。

I'm using the support library. Now, I want to have a fragment shifting in from the bottom, moving OVER the previous one.

为此,我用它来保持previous片段(正在被滑动过的)可见,直到新的片段是在它的地方:

For this I use this to keep the previous fragment (the one that is being slided over) visible until the new fragment is in its place:

<alpha xmlns:android="http://schemas.android.com/apk/res/android"
   android:fromAlpha="1.0" android:toAlpha="1.0" 
   android:duration="2500"
   android:zAdjustment="bottom" />

这是用于新的片段从底部滑动动画:

this is animation used for the new fragment to slide in from bottom:

<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="100%p" android:toYDelta="0"
        android:duration="@android:integer/config_mediumAnimTime" 
        android:zAdjustment="top"/>

我把Z轴调整的底部和顶部两个,但仍是自下而上的动画仍然在新片段的顶部!我已经把持续到2500进行测试,它停留在顶部的全部时间。

I've put the z adjustment to bottom and top for both, but still the 'bottom' animation is still on top of the new fragment! I have put the duration to 2500 for testing and it stays on top for the whole time.

难道zAdjustment不是片段动画工作?

Does zAdjustment not work for fragment animations?

推荐答案

谷歌组线程ž调整仅适用于窗口动画。

According to this google group thread Z adjustment only works for window animations.

Z轴调整仅适用于窗口动画。我认为这是记录在案,但显然不是。
- 黛安娜Hackborn(Android框架工程师)

"The Z adjustment only works for window animations. I thought this was documented, but apparently not." -- Dianne Hackborn (Android framework engineer)

这篇关于片段,安卓:zAdjustment(Z顺序)和动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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