问题描述
我使用了 touchAnchorId ,因此运动版式仅在我滑动单个区域时适用,因为在 recyclerview 上自动滚动时没有它向上拖动。
<Transition
motion:constraintSetStart="@id/start"
motion:constraintSetEnd="@id/end"
motion:duration="400"
motion:motionInterpolator="linear">
<OnClick motion:targetId="@+id/close" />
<OnSwipe
motion:maxAcceleration="800"
motion:dragDirection="dragUp"
motion:touchRegionId="@id/constraintLayout"
motion:touchAnchorId="@+id/constraintLayout"
motion:touchAnchorSide="top" />
<KeyFrameSet>
</KeyFrameSet>
</Transition>
但是在使用touchAnchorId之后,我无法使用该播放,skip_next和skip_previous不知道为什么。谁能帮我修复我的代码
用黄色圆圈圈出的按钮不起作用
解决方法
我改变了
motion:touchRegionId="@id/constraintLayout"
到
motion:touchRegionId="@id/parent_layout"
它现在可以正常工作
(parent_layout是整个约束布局的ID(定义整个ui的父约束布局)
如果有人需要整个xml文件的代码,请在注释中提问