【问题标题】:To disable a listview in a fragment thanks to a view behind由于后面的视图而禁用片段中的列表视图
【发布时间】:2020-12-25 03:32:52
【问题描述】:

当活动上出现弹出窗口时(弹出窗口是一组视图),我想禁用片段中的列表视图。我不想使用属性 visibility.gone 因为我想要一种样式效果:我想使用带有 alpha 的视图颜色来模拟禁用的背景。

我已经尝试用透明的 alpha 颜色屏蔽列表视图。但是listview的编辑文本是可点击的,并且可以再次滚动。

感谢任何提示,我可以叠加列表视图并“禁用”它吗?

【问题讨论】:

  • 在透明视图 XML 中,添加 clickable= truefocusable=true
  • 太棒了。它确实有效。非常感谢 !感谢您,我设置的是: android:clickable="true" android:contextClickable="true" android:focusable="auto" android:focusableInTouchMode="true" android:longClickable="true" 您可以添加答案并我投票支持你的答案。

标签: android listview kotlin


【解决方案1】:

在您的 XML 中,将以下属性添加到透明视图:

android:clickable="true"
android:contextClickable="true"
android:focusable="auto"
android:focusableInTouchMode="true"
android:longClickable="true"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-20
    • 2016-07-24
    • 1970-01-01
    • 1970-01-01
    • 2021-10-31
    • 2017-12-08
    • 2012-07-31
    相关资源
    最近更新 更多