滑动时减慢motionLayout动画

Rai*_*ker 8 android android-motionlayout

我有motionLayout动画transition

<Transition
        app:constraintSetEnd="@+id/end"
        app:constraintSetStart="@+id/start">
        <OnSwipe
            app:dragDirection="dragUp"
            app:dragScale="0.1"
            app:touchAnchorId="@id/my_scrollview" />
</Transition>
Run Code Online (Sandbox Code Playgroud)

但是动画对我来说太快了。我想慢下来。我尝试设置,dragScale=0.1, maxAcceleration=1, maxVelocity=1但它不会影响动画速度。我怎样才能让它慢下来?

更新:问题已在较新版本中修复,constraintlayout并且似乎正在处理中"2.0.4"

小智 1

根据Android 开发人员文档, Transition 类有一个可以在 XML 文件中设置的属性,称为android:duration. 尝试通过指定转换应运行的时间量(以毫秒为单位)来使用它。

  • 我尝试了持续时间,但它不适用于滑动。动画时间不是恒定的 - 滑动越快 - 动画进行得越快。 (4认同)