关闭DrawerLayout的手势滑动
Posted dx我是大雄
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关闭DrawerLayout的手势滑动相关的知识,希望对你有一定的参考价值。
/**
* The drawer is unlocked.
*/
public static final int LOCK_MODE_UNLOCKED = 0;
/**
* The drawer is locked closed. The user may not open it, though
* the app may open it programmatically.
*drawe默认关闭且锁住,用户虽然打不开他(也就是直接手势),但是可以通过代码打开
*/
public static final int LOCK_MODE_LOCKED_CLOSED = 1;
/**
* The drawer is locked open. The user may not close it, though the app
* may close it programmatically.
*drawer默认打开且锁住,用户不能关闭,但是可以通过代码关闭
*/
public static final int LOCK_MODE_LOCKED_OPEN = 2;
/**
* The drawer's lock state is reset to default.
*/
public static final int LOCK_MODE_UNDEFINED = 3;
//关闭手势滑动
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
//打开手势滑动
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
以上是关于关闭DrawerLayout的手势滑动的主要内容,如果未能解决你的问题,请参考以下文章