如何禁用背着我SlidingDrawer在Android的一个看法? [英] How can I disable a view behind my SlidingDrawer in Android?

查看:102
本文介绍了如何禁用背着我SlidingDrawer在Android的一个看法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个SlidingDrawer弹出从屏幕的底部,并充满了屏幕80%左右。即使SlidingDrawer视图清晰,它仍然是可能的点击项,按钮和在作为SlidingDrawer背后视图其他元素。当SlidingDrawer激活/拉/焦点,我想禁用整个视图背后所以它不能够接受她的点击和触摸。是否有禁用整个视图的好方法?我曾尝试setEnable(假)和setClickable(假),但他们都没有工作。

I have a SlidingDrawer that pops up from the bottom of the screen and fills the screen about 80%. Even though the SlidingDrawer view is in focus, it is still possible to click on items, buttons and other elements in the view that is behind the SlidingDrawer. When SlidingDrawer is active/pulled up/in focus, I want to disable the entire view behind it so it will not be able to recieve clicks and touches. Is there a good way to disable an entire view? I have tried setEnable(false) and setClickable(false) but neither of them work.

帮助?

推荐答案

这里有一个方法来解决这个问题(我需要一个解决方案也可以) - 抢保存的内容的LinearLayout并添加点击侦听器。有点击听众响应点击(扔掉,等等) - 这然后停止它传播到滑动抽屉下方的观点 - 它为我工作 - 它不会阻止在抽屉中的其他项目

Here's a way to get around this problem (I needed a solution also) - grab the linearLayout that holds the contents and add a click listener. Have the click listener respond to clicks (throw away, whatever) - and this then stops it propagating to the view below the sliding drawer - it works for me - and it doesn't block the other items in the drawer.

这篇关于如何禁用背着我SlidingDrawer在Android的一个看法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆