我正在尝试使用动画,同时替换fragments
(使用replace()
的fragment transaction
)。我设置了setCustomAnimations()
。 我的animation
正尝试将旧的fragment
与从右侧移动的新旧重叠。但问题是:即使已经与新版本重叠,我仍可以从旧版本fragment
中看到意见。只有当动画完成时,旧的views
消失。此外,当一个新的fragment
是一个复杂的(listviews
等),我可以看到一些文物和重叠闪烁。 这太可怕了,我该如何避免这种情况?片段交易动画覆盖
我的代码输入animation
:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:ordering="together">
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:propertyName="x"
android:valueType="floatType"
android:valueTo="0"
android:valueFrom="720"
android:duration="250"
android:zAdjustment="top"/>
</set>
UPDATE:关于文物 - 这不是他们。这只是糟糕覆盖的后果。我慢慢看动画。 所以问题是:旧片段停留在TOP。它在动画时完全重叠新的一个。
可能的重复[丑陋的片段过渡到覆盖层surfaceview](http://stackoverflow.com/questions/14925060/ugly-fragment-transition-to-surfaceview-with-overlay) –
我没有SurfaceView ,在所有片段上重叠也是不好的,不仅困难的(与列表视图) –