【发布时间】:2020-11-05 14:58:57
【问题描述】:
我想在MVVMCross项目中实现导航时进入退出片段动画。
[MvxFragmentPresentation(typeof(TestViewModel),
Resource.Id.content_frame, true,
Resource.Animation.enter_from_right,
Resource.Animation.exit_nothing_animation)]
enter_from_right
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate
android:fromXDelta="100%p" android:toXDelta="0%"
android:fromYDelta="0%" android:toYDelta="0%"
android:duration="@android:integer/config_mediumAnimTime" />
</set>
exit_nothing_animation
<?xml version="1.0" encoding="UTF-8" ?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:fromAlpha="1"
android:toAlpha="1" />
我希望新片段从旧 frgamnet 的右侧滑过,旧片段将保留在同一个地方。
但是新片段只是立即出现,没有动画
其他主题建议使用 Add insted Replace,但 MVVMCross 项目中的正确方法是什么?
【问题讨论】: