只有在特定的片段禁用右抽屉 [英] Disabling right drawer only on specific fragment

查看:104
本文介绍了只有在特定的片段禁用右抽屉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有活动 DrawerLayout (其中包含左,右抽屉)。我在想,如果我可以禁用来自特定片段右抽​​屉。

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

我读过有关 mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED),但它会锁定整个抽屉关闭,我还需要左抽屉

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

推荐答案

DrawerLayout.setDrawerLockMode(INT lockmode可以)锁定所有的抽屉,而是锁定一个特定的抽屉,你可以使用下列之一:

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

这篇关于只有在特定的片段禁用右抽屉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆