【问题标题】:How to dim the background other than the view which was clicked如何使单击的视图以外的背景变暗
【发布时间】:2017-02-06 01:36:39
【问题描述】:

点击活动布局中的视图时,是否可以使活动的整个背景变暗而不是视图的背景?

我可以找出弹出窗口的背景变暗。但这不适用于此要求。

【问题讨论】:

  • 如果您选择使用 Shape Draw 来绘制您的视图,然后使除该视图之外的所有内容变暗,请使用:stackoverflow.com/questions/7584641/… 如果您尝试使用 PopupWindow,请尝试:WindowManager 或 View Overlay。跨度>

标签: android view background onclick


【解决方案1】:

这是一项非常艰苦的工作。 看到这个案例。 “A”根布局有 5 个子视图(a、b、c、d、e)。 “a”子视图单击,以防其他 5 个视图更改背景图像(或 alpha 值)。 onClickListener 中的每个视图都需要该代码。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-16
    • 1970-01-01
    • 1970-01-01
    • 2017-03-07
    • 2019-06-11
    • 1970-01-01
    相关资源
    最近更新 更多