Why Am I Able To Click "behind" The Bottomsheet In Android?
I have a BottomSheet in my Activity. I'm calling behavior.setState(BottomSheetBehavior.STATE_EXPANDED); to show the bottom sheet and it works fine, but the problem I have is that
Solution 1:
A simple solution is to add the
android:clickable="true"
attribute to the layout that you are using for your bottom sheet. That way it will capture all clicks, and not let them bleed through. You do not have to set an onClick
method for it, as you have no need to handle them.
Solution 2:
I faced same issue !
Add android:clickable=true
to your BottomSheet ! Should look like below !
<LinearLayoutandroid:clickable="true"android:layout_width="match_parent"android:layout_height="match_parent"android:background="@color/materialWhite"android:orientation="vertical"app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"></LinearLayout>
Post a Comment for "Why Am I Able To Click "behind" The Bottomsheet In Android?"