当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
RealBasicVSR测试图片、视频
学习突围2 - 关于高效学习的方法
一文读懂数仓中的pg_stat
PAcP learning note 1: programming with pcap
Mongodb replication (replica set) summary
JS function returns multiple values
1. Deep copy 2. Call apply bind 3. For of in differences
JS判断一个对象是否为空
Cookie and session comparison
分布式事务解决方案
记一次 .NET 某新能源系统 线程疯涨 分析
Analysis of DHCP dynamic host setting protocol
ESP32系列专栏
leecode3. 无重复字符的最长子串
How to make join run faster?
Cmake learning and use notes (1)
抓细抓实抓好安全生产各项工作 全力确保人民群众生命财产安全
PCAP学习笔记二:pcap4j源码笔记
PACP学习笔记三:PCAP方法说明
【等保】云计算安全扩展要求关注的安全目标和实现方式区分原则有哪些?