How to disable behind view click event Framelayout

前端 未结 9 1325
遥遥无期
遥遥无期 2020-12-04 20:53

Here i have one view pager activity which has one imageview and 2 overlay bars. there overlay bars i made using android xml file layout itself.

Here my requirement i

9条回答
  •  借酒劲吻你
    2020-12-04 21:08

    By default, some controls have clickable property as true. But the layout doesn't. For layout, we have to make them explicitly clickable so that it will grab the events of clicks or touches and will not let it pass to background views. This is how we do it:

    android:clickable="true"
    android:focusable="true"
    android:focusableInTouchMode="true"
    

    Add these lines to all your layouts, so that it will grab/absorb events and will not let it pass to background views.

提交回复
热议问题