Android: delegate touch event to underlaying view

前端 未结 3 788
旧时难觅i
旧时难觅i 2020-12-24 13:54

I have the following hierarchy: Activity -> PopupWindow -> CustomView

My the PopupWindow itself is a square, but

3条回答
  •  清歌不尽
    2020-12-24 14:05

    It's too bad that the PopupWindow is not a subclass of ViewGroup or even View. Then you could override dispatchTouchEvent. Can you modify your custom view to know about the PopupWindow and call dismiss() on it when there is a click outside the circle?

提交回复
热议问题