【问题标题】:Disable selectableItemBackgroundBorderless On Hold禁用 selectableItemBackgroundBorderless On Hold
【发布时间】:2016-06-01 04:07:59
【问题描述】:

我在CardView 中有一个ImageButton,当我按住CardView 时,它会得到一个黑色的覆盖层。如果在CardView 内有任何具有?attr/selectableItemBackgroundBorderless 背景的项目,它们将获得相同的保持效果并显示在CardView 之上,即使没有触摸它们。

例子:

普通:

CardView 按下:

如何防止带有?attr/selectableItemBackgroundBorderless 的项目在未被触摸时出现?

【问题讨论】:

    标签: android android-cardview rippledrawable


    【解决方案1】:

    尝试在ImageButton 上设置android:duplicateParentState="false"

    或者,如果单击> 图标与单击CardView 具有相同的效果,请考虑使用常规的、不可单击的ImageView 而不是ImageButton

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-12
      • 1970-01-01
      • 2018-10-27
      • 2018-01-12
      • 2021-05-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多