我正在尝试在使用
我的进入
因此,问题在于:旧片段保持在最上层,并在动画过程中完全覆盖新片段。
fragment transaction
的replace()
时使用动画。我使用setCustomAnimations()
设置动画。
我的animation
试图将从右侧移动的新fragment
与旧fragment
重叠。但问题是:即使新fragment
已经覆盖了旧的fragment
,我仍然可以看到旧的views
。只有当动画完成后,旧的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>
更新:关于工件的问题-不是它们。这只是错误叠加的后果。我观看了动画慢慢地。因此,问题在于:旧片段保持在最上层,并在动画过程中完全覆盖新片段。