当前位置:网站首页>Drawerlayout suppress sideslip display
Drawerlayout suppress sideslip display
2022-07-07 13:29:00 【The ancient moon cannot be seen by modern people. This moon onc】
explain :
Android DrawerLayout Sometimes the sideslip display is not required , At this time, it is necessary to prohibit side sliding .
Just one line of code .
Code :
// No gesture sliding
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
// Open gesture slide
mDrawer_layout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED)
After initialization, add the following :
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
toggle.syncState();
————————————————
Reproduced in :https://blog.csdn.net/u012246458/article/details/80162799
边栏推荐
猜你喜欢
随机推荐
Esp32 series column
Analysis of DHCP dynamic host setting protocol
[learning notes] segment tree selection
centso7 openssl 报错Verify return code: 20 (unable to get local issuer certificate)
JS determines whether an object is empty
简单好用的代码规范
Write it down once Net a new energy system thread surge analysis
Japanese government and enterprise employees got drunk and lost 460000 information USB flash drives. They publicly apologized and disclosed password rules
Navicat运行sql文件导入数据不全或导入失败
Getting started with MySQL
迅为iTOP-IMX6ULL开发板Pinctrl和GPIO子系统实验-修改设备树文件
ORACLE进阶(五)SCHEMA解惑
【学习笔记】线段树选做
OSI seven layer model
[1] ROS2基础知识-操作命令总结版
Cinnamon Applet 入门
PCAP学习笔记二:pcap4j源码笔记
抓细抓实抓好安全生产各项工作 全力确保人民群众生命财产安全
Detr introduction
【Presto Profile系列】Timeline使用