Drawer toggle button not displaying on Action Bar

前端 未结 2 729
后悔当初
后悔当初 2021-01-27 20:02

I have two activities in my app and both have navigation drawers implemented. Now the scenario is that the Drawer toggle is getting displayed for the first activity but for the

2条回答
  •  借酒劲吻你
    2021-01-27 20:32

    Ok after struggling for 2 days I finally found what the problem was. drum rolls please ....

    The problem was : Z INDEX OF THE CUSTOM ACTION BAR LAYOUT INSIDE DRAWER LAYOUT.

    You heard it .. if you are facing similar issues like for example your custom action bar layout is not displaying or your drawer toggle button is not displaying the first thing you should check if your action bar layout is placed down below all your main layouts to increase its z order.

    In my case I placed it above my main layouts in the drawer layout. And the funny thing is Android Studio's preview window was still displaying the custom action bar as if it doesn't even care about the z index.

提交回复
热议问题