通过在运动布局中使用touchAnchorId按钮不起作用

问题描述

我使用了 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不知道为什么。谁能帮我修复我的代码

Image showing start or the activity_main

用黄色圆圈圈出的按钮不起作用

解决方法

我改变了

motion:touchRegionId="@id/constraintLayout"

motion:touchRegionId="@id/parent_layout"

它现在可以正常工作

(parent_layout是整个约束布局的ID(定义整个ui的父约束布局)

如果有人需要整个xml文件的代码,请在注释中提问

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...