What do you need to pass to v4.widget.DrawerLayout.isDrawerOpen()/.openDrawer()/.closeDrawer()

后端 未结 4 1237
死守一世寂寞
死守一世寂寞 2020-12-18 18:30

I\'ve been trying to move my code across to the DrawerLayout as suggested by android here as SlidingDrawer is deprecated.

My problem is tha

4条回答
  •  长情又很酷
    2020-12-18 18:39

    And, the answer:

    The second child (aka, the "Drawer") is what needs to be passed to the methods. My problem was that by the time I had figured that out I'd reduced the layout to as simple as possible implementation to test - I'd removed the gravity from the "drawer". Without a gravity, you get the above completely unrelated error messages.

    I can confirm I got the code to work using the following setup:

    mMenuPanel.isDrawerOpen(findViewById(R.id.drawer));
    

    and with the layout:

    
    
        
    
         
    
    

提交回复
热议问题