当前位置:网站首页>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
边栏推荐
- 机器学习10-信念贝叶斯分类器
- For the sustainable development of software testing, we must learn to knock code?
- [stack] 921 Minimum Add to Make Parentheses Valid
- Working for eight years as a programmer, but with a salary of three years after graduation, it's too late to be enlightened again
- After working for 6 years, let's take stock of the golden rule of the workplace where workers mix up
- Some essential differences
- 7-2 拼题A打卡奖励 dp
- KS009基于SSH实现宠物管理系统
- P6773 [NOI2020] 命运(dp、线段树合并)
- [dynamic planning] path dp:931 Minimum Falling Path Sum
猜你喜欢

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

KS009基于SSH实现宠物管理系统
![[Qt5 tab] tab label and content hierarchical analysis](/img/cc/c8c2e79877a958f742a8e9e60ceb43.png)
[Qt5 tab] tab label and content hierarchical analysis

删除重复的电子邮箱

Necessary tools for testing - postman practical tutorial

PHP crawls data through third-party plug-ins

The personal test is effective, and the JMeter desktop shortcut is quickly created

There is no future to be expected. It is just the last fantasy of a migrant worker before he dies

Creating ASCII art with C #

那些一门心思研究自动化测试的人,后来怎样了?
随机推荐
修复表中的名字(首字符大写,其他小写)
laravel+redis 生成订单号-当天从1开始自增
When facing the industrial Internet, they even use the ways and methods of consuming the Internet to land and practice the industrial Internet
7-2 punch in reward DP for puzzle a
mysql插入\更新前+判断条件
正向代理和反向代理快速理解
Laravel+redis generates an order number - automatically increase from 1 on the same day
What are the preferential activities for stock account opening? In addition, is it safe to open a mobile account?
Handsontable數據網格組件
对象与对象变量
Laravel event & Monitoring
Mathematical knowledge: finding combinatorial number IV - finding combinatorial number
TypeError: can‘t convert cuda:0 device type tensor to numpy. Use Tensor. cpu() to copy the tensor to
[Agora] user management
Check the disk usage of MySQL database
删除重复的电子邮箱
The argument type 'function' can't be assigned to the parameter type 'void function()‘
45 year old programmer tells you: why do programmers want to change jobs? It's too true
Unknown database connection database error
Understanding and application of Qt5 layout in creation