Say you have a view that is a circle or a balloon and you want have two layers of onClick or onTap capturing.
For example a mapView with a balloon over top.
The image has transparency to it on the left and right of the spike. Does anyone know of a way to cut out this transpa开发者_开发技巧rency to not absorb the onClick and let it pass through to the mapview instead?
Do you know the dimensions of the ballon? If so then find out the left top of the ballon in the layout and then in the onTouch
method find out the current co-ordinates where the touch event occured.
If this new touch co-ordinates are within the body of ballon then handle it otherwise just return false
from the ballon's onTouch
method. Now android should pass on the event to the underlying view which would be you mapView.
精彩评论