android - 如何在 constraint.Group 中设置涟漪 (android:foreground="?selectableItemBackground")
问题描述
我的item_layoutcontraint.Group
里面有一个,我将在recyclerView中使用它:
<android.support.constraint.Group
android:id="@+id/constraintGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="imageView, textView" />
我还在完美运行的活动中为该组设置了onClickListener 。问题是每次我点击该组时,都不存在连锁反应。
任何人都知道我应该怎么做才能在constraint.Group中产生这种效果?
我尝试将属性添加android:foreground="?selectableItemBackground"
到父级和约束。组但它不起作用:(
解决方案
AGroup
仅用于控制可见性。您无法控制组成员的任意 UI 属性,例如背景。相反,您需要将背景放在实际的小部件上。
推荐阅读
- r - 在 R 中,如何创建命名列表和动态生成变量的函数
- python - 我如何知道 jenkins 构建是否已经在 Python 中启动?
- webpack-4 - Quasar v1 使用 webpack 4 和 laravel-mix 摇树
- python - Python 使用 Selenium 为 If Else 条件定位 404 错误
- bash - 在 bash 提示符中替换 CWD 的部分内容 (Git Bash)
- c++ - 在 bool 中设置额外的位使其同时为真和假
- c - 具有多个空字符的字符缓冲区
- google-cloud-dataflow - Apache Beam - 在多个 GroupByKey 之后,Windows/触发器会发生什么?
- javascript - 如何更改opencart在购物车中计算价格的方式
- javascript - Primefaces自动完成保留选定的下拉值