TouchAnchorId不完全是MotionLayout Android中的OnSwipe

我编写了一些代码以将视图向右拖动,但无法正常工作,这是错误信息: Screenshot here

<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layoutDescription="@xml/stream_motion">
<View
        android:id="@+id/button"
        android:layout_width="64dp"
        android:layout_height="64dp"
        android:background="@color/coloraccent"
        android:text="Button" />

</androidx.constraintlayout.motion.widget.MotionLayout>

我的过渡:

<Transition
        motion:constraintSetEnd="@+id/end"
        motion:constraintSetStart="@id/start"
        motion:duration="1000">
        <OnSwipe
            motion:touchAnchorId="@+id/button"
            motion:touchAnchorSide="right"
            motion:dragDirection="dragRight" />
        <OnSwipe />
    </Transition>

我可以在按钮视图中向右拖动。

tencent54555 回答:TouchAnchorId不完全是MotionLayout Android中的OnSwipe

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3167464.html

大家都在问