开发者

View receives touch events when covered by other view

My Android app has a layout that looks like this:

---------------------
|                   |
|      button       |  <- View panel A
|                   |
---------------------
|                   |
|                   |  <- view panel B (a SurfaceView)
|                   |
|-------------------|

I use a relative layout so that panel B fills the whole screen and panel A is at the top of the screen covering the top of panel B. A is slightly transparent so you can see B under it. Pressing the button on panel A works as expected.

My problem: if I press anywhere on panel A outside of the button, panel B开发者_StackOverflow中文版 receives a touch event. How can I stop this behaviour?


Create a clickListener and attach it to Panel A and dont do anything in that clickListener

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜