Disabling right drawer only on specific fragment

心不动则不痛 提交于 2020-01-03 11:13:08

问题


I have Activity with DrawerLayout (which contains left and right drawer). I was wondering if I could disable right drawer from specific fragments.

I've read about mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED), but it would lock whole drawer closed, and I still need the left drawer


回答1:


DrawerLayout.setDrawerLockMode(int lockMode) locks all the drawers, but to lock a specific drawer you can use one of the following:

  • DrawerLayout.setDrawerLockMode(int lockMode, int edgeGravity)
  • DrawerLayout.setDrawerLockMode(int lockMode, View drawerView)


来源:https://stackoverflow.com/questions/22858420/disabling-right-drawer-only-on-specific-fragment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!