当前位置:网站首页>Short video platform development, relying on drawerlayout to achieve side sliding menu effect
Short video platform development, relying on drawerlayout to achieve side sliding menu effect
2022-07-01 01:49:00 【Yunbao network technology】
Short video platform development , rely on DrawerLayout Achieve sideslip menu effect
activity_main.xml
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<!-- Right side view -->
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- Left menu -->
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>
And then in res Add a... In the folder menu Menu folder , You don't need to add what has been added
In the above code NavigationView There's a app:menu=”@menu/activity_main_drawer” Corresponding to the following :
Add a menu file , Random names , My is activity_main_drawer.xml
activity_main_drawer.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_camera"
android:icon="@drawable/ic_menu_camera"
android:title=" first line " />
<item
android:id="@+id/nav_gallery"
android:icon="@drawable/ic_menu_gallery"
android:title=" The second line " />
<item
android:id="@+id/nav_slideshow"
android:icon="@drawable/ic_menu_slideshow"
android:title=" The third line " />
<item
android:id="@+id/nav_manage"
android:icon="@drawable/ic_menu_manage"
android:title=" In the fourth row " />
</group>
<item android:title="Communicate">
<menu>
<item
android:id="@+id/nav_share"
android:icon="@drawable/ic_menu_share"
android:title=" The fifth row " />
<item
android:id="@+id/nav_send"
android:icon="@drawable/ic_menu_send"
android:title=" Sixth elements " />
</menu>
</item>
</menu>
That's all Short video platform development , rely on DrawerLayout Achieve sideslip menu effect , More content welcome to follow the article
边栏推荐
- 3500字归纳总结:一名合格的软件测试工程师需要掌握的技能大全
- 【agora】用户管理
- [dynamic planning] path dp:931 Minimum Falling Path Sum
- Necessary tools for testing - postman practical tutorial
- TypeError: Argument ‘angle‘ can not be treated as a double
- 正向代理和反向代理快速理解
- Factory + strategy mode
- 如何学习和阅读代码
- Sitge joined the opengauss open source community to jointly promote the ecological development of the database industry
- Selenium经典面试题-多窗口切换解决方案
猜你喜欢

小程序中实现excel数据的批量导入

3500 word summary: a complete set of skills that a qualified software testing engineer needs to master

计算特殊奖金

(翻译)使用眉状文本提高标题点击率

7-2 拼题A打卡奖励 dp

求两个线段公共部分的长度

聚焦绿色低碳,数据中心散热进入“智能冷却”新时代

(翻译)实时内联验证更容易让用户犯错的原因

Electron pit Addon

The argument type 'function' can't be assigned to the parameter type 'void function()‘
随机推荐
Some items of OCR
Handsontable数据网格组件
AS400 API 从零到一的整个历程
Some essential differences
P6773 [NOI2020] 命运(dp、线段树合并)
C # customize and dynamically switch cursor
数学知识:求组合数 IV—求组合数
计算特殊奖金
Necessary tools for testing - postman practical tutorial
laravel 事件 & 监听
org.redisson.client.RedisResponseTimeoutException: Redis server response timeout (3000 ms)错误解决
Lecun, a Turing Award winner, pointed out that the future of AI lies in self-learning, and the company has embarked on the journey
Analysis on user behavior loss of data exploration e-commerce platform
测试必备工具—Postman实战教程
Compile and install oh my Zsh
[无线通信基础-14]:图解移动通信技术与应用发展-2-第一代移动模拟通信大哥大
org. redisson. client. Redisresponsetimeoutexception: redis server response timeout (3000 ms) error resolution
laravel Carbon 时间处理类使用
Sort custom function
Ks009 implementation of pet management system based on SSH