How to create an overlay that blocks touch events to UI below it?

前端 未结 5 1447
伪装坚强ぢ
伪装坚强ぢ 2021-02-05 17:27

I used a layer of framelayout with a semi-translucent background to create an overlay. But this overlay doesn\'t block touch events to interact with the views below it. How sho

5条回答
  •  深忆病人
    2021-02-05 17:58

    If overlay doesn't get touch events, then the events are passed to underlying view, so to block touch events in views below it, make your overlay touchable. android:clickable="true"

提交回复
热议问题