issue in Android Fragment : still click on previous fragment

前端 未结 2 509
醉梦人生
醉梦人生 2021-02-05 07:47

I have developed an application that have navigation Drawer and many fragment inside drawer so I getting issue while I am open fragment inside fragment, in one fragment I have L

2条回答
  •  旧巷少年郎
    2021-02-05 08:25

    Take a look at this question of mine:

    An invisible layout behind the fragment is getting clicked:

    What helped me in this case and as the accepted answer states is to add the

    android:clickable="true"

    property to the top hierarchy ViewGroup of the layout you designed for the fragment on top ( the one that is being clicked through). That way the top fragment intercepts your clicks no matter where they occur (and even if no action is applied to it) and are not being passed to the lower level fragment/activity layout.

提交回复
热议问题