开发者

Cut out transparency of a view to not capture onclick?

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜