How to disable behind view click event Framelayout How to disable behind view click event Framelayout android android

How to disable behind view click event Framelayout


A better way is to set the top and bottom frame to be clickable, with:

android:clickable="true"

Doing so will make sure that the view/frame itself will trap all clicking events, and will not pass it through the view behind it. Note this method works for all layout/view/controls, but many controls (such as buttons) already have this function on by default.


android:clickable="true" for top and bottom bar.

or give each FrameLayout an onClickListener.


just add this to each of your framelayout view containers so that absorb the click:

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