如何禁用布局的所有点击事件? [英] How to disable all click events of a layout?
本文介绍了如何禁用布局的所有点击事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含许多视图的布局。有没有一种简单的方法来禁用它的所有视图点击事件?
I have a layout that contains many views. Is there an easy way to disable all its views click events?
推荐答案
我想创建一个的ViewGroup
与所有要启用/在同一时间禁用的意见并调用 setClickable(真/假)
来开启/关闭点击。
I would create a ViewGroup
with all the views that you want to enable/disable at the same time and call setClickable(true/false)
to enable/disable clicking.
这篇关于如何禁用布局的所有点击事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文