android - On click isn't fired on recyclerview in nestedscrollview under coordinatorlayout in Android
问题描述
There're two dimentional recyvlerview under nested scroll view under coordinator layout. Clicking to RC items isn't firing with coordinator layout, without it firing good. How to solve it?
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:id="@+id/main_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true">
<androidx.core.widget.NestedScrollView
android:id="@+id/main_nsv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#AB9984"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/main_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:scrollbars="none"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".activity.MainActivity">
</androidx.recyclerview.widget.RecyclerView>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
解决方案
推荐阅读
- php - 如何注册 Prestashop 组件 JavaScript 文件?
- apache-flink - Apache Flink:接收器是否将检查点期间从流缓冲的项目存储到检查点状态?
- python - discord.py 禁用词 automod
- css - SweetAlert2 内容比警报宽图标的宽度
- python - 使用 Counter() 查找字典中的键
- google-sheets - 创建自定义季度分组 - 3 月至 5 月、6 月至 8 月等
- bash - Bash - 打印包含数组项的字符串会导致奇怪的图形错误 - 数组内没有特殊字符
- php - 贝宝支付成功后发布到 PHP 脚本
- terminal - 在状态栏中显示最后一个用户输入命令以执行长时间运行的任务
- javascript - CORS 阻止具有相同来源的 javascript 获取请求