当前位置:网站首页>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
边栏推荐
猜你喜欢
MongoDB内部的存储原理
自定义线程池拒绝策略
MySQL入门尝鲜
ESP32构解工程添加组件
LED light of single chip microcomputer learning notes
centso7 openssl 报错Verify return code: 20 (unable to get local issuer certificate)
数字ic设计——SPI
Per capita Swiss number series, Swiss number 4 generation JS reverse analysis
单片机学习笔记之点亮led 灯
Cmake learning and use notes (1)
随机推荐
抓细抓实抓好安全生产各项工作 全力确保人民群众生命财产安全
RecyclerView的数据刷新
Introduction and basic use of stored procedures
DrawerLayout禁止侧滑显示
How did Guotai Junan Securities open an account? Is it safe to open an account?
LIS 最长上升子序列问题(动态规划、贪心+二分)
ROS机器人更换新雷达需要重新配置哪些参数
How to make join run faster?
Go language learning notes - structure
Centso7 OpenSSL error Verify return code: 20 (unable to get local issuer certificate)
详细介绍六种开源协议(程序员须知)
国泰君安证券开户怎么开的?开户安全吗?
解决缓存击穿问题
PCAP学习笔记二:pcap4j源码笔记
单片机学习笔记之点亮led 灯
Realbasicvsr test pictures and videos
1. Deep copy 2. Call apply bind 3. For of in differences
LED light of single chip microcomputer learning notes
【学习笔记】zkw 线段树
Mongodb command summary