由于后面的视图,禁用片段中的列表视图

To disable a listview in a fragment thanks to a view behind

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

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

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

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

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