Android:Slidingdrawer.lock() 阻止布局其余部分的触摸输入
我有一个带有viewFlipper 和slidingDrawer 的活动。 SlidingDrawer 的处理程序包含一个额外的可单击按钮。
问题是,处理程序上的额外按钮仅在 sliderDrawer 锁定时注册 onClick,而当 sliderDrawer 锁定时,viewFlipper(布局的其余部分)不再响应gestureListener,因此我无法在视图之间翻转。
有没有人对如何在 sliderDrawer 的处理程序上制作一个可点击的额外按钮,同时在 viewFlipper 上有一个可用的手势侦听器有任何建议?
也许有人知道为什么 slipDrawer.lock() 会阻止布局其余部分的触摸输入?
谢谢!
I have an Activity with a viewFlipper and a slidingDrawer.
The SlidingDrawer's Handler contains an extra button wich is clickable.
The problem is, the extra button on the handler only registers onClick when the slidingDrawer is locked, and when the slidingDrawer is locked, the viewFlipper (the rest of the layout) does not respond to the gestureListener anymore and therefore I cannot flip between views.
Does anyone have any suggestions on how to make an extra button on a slidingDrawer's handler clickable and at the same time have a working gesturelistener on the viewFlipper?
Maybe someone knows why slidingDrawer.lock() would block the touch input for the rest of the layout?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是一个已知问题
请参阅此解决方案
http://code.google.com/p/android/issues/detail ?id=17844
This is a known issue
See this solution
http://code.google.com/p/android/issues/detail?id=17844
这个解决方案对我有用:扩展SlidingDrawer并重写onTouchEvent方法(如果slidingdrawer被锁定,应该返回false而不是true):
this solution works for me : extend SlidingDrawer and override onTouchEvent method (should return false and not true if slidingdrawer is locked) :
我找到了导致此问题的滑动抽屉的哪个部分。如果slidingDrawer被锁定,onInterceptTouchEvent()方法返回false。
不管怎样,我通过创建一个新的 Activity 来伪造一个 sliderDrawer 来“解决”这个问题,该 Activity 可以使用以下方法上下滑动:
缺点当然是不再可以用手指拖动抽屉。
I found what part of the slidingDrawer that was causing this. The onInterceptTouchEvent() method returns false if the slidingDrawer is locked.
Anyway, I "solved" this problem by fakeing a slidingDrawer by creating a new Activity wich slides up and down using:
The downside is ofcourse that it is no longer possible to drag the drawer with your finger.