android - setDrawerLockMode 的 XML 替代方案
问题描述
我想将DrawerLayout的锁定模式设置为,DrawerLayout.LOCK_MODE_LOCKED_CLOSED
但我想使用 XML 属性而不是以编程方式进行。有点像下面的无效 XML:
<androidx.drawerlayout.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:lock_mode = "close"
android:layout_width="match_parent"
android:layout_height="match_parent">
注意: XML 代码android:lock_mode = "close"
不存在。
解决方案
推荐阅读
- android - 在图像视图上应用 ColorFilter 的问题
- spring-boot - “空编码密码”调用没有客户端密码的令牌
- javascript - 如何从父组件更改子组件?
- javascript - 如何通过ajax单击按钮后从数据库中获取ID
- javascript - Kendo UI - 文本颜色更改点击取消
- javascript - 是否有通过索引从数组中获取字符串的函数
- javascript - 如何在时刻以小时格式减去两个小时格式
- wordpress - 如何在 WordPress 中检索 post_type 的查询列表?
- popup - 如何为gmail收件箱中使用inboxsdk创建的按钮添加操作?
- angular - 如何重新订购 Angular 材料表?