当前位置:网站首页>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
边栏推荐
- PHP crawls data through third-party plug-ins
- PHP converts two-dimensional array elements into key value pairs
- AS400 large factory interview
- [Qt5 basics] random number display
- Sun Yuchen told Swiss media Bilan that the bear market will not last long
- 【2022年】江西省研究生数学建模方案、代码
- Opencv -- Notes
- AS400 大廠面試
- With regard to the white box test, you have to master these skills~
- 修复表中的名字(首字符大写,其他小写)
猜你喜欢

Creating ASCII art with C #

zabbix如何配置告警短信?(预警短信通知设置流程)

How to maintain efficient collaboration in remote office and achieve stable growth of projects | community essay solicitation

Selenium经典面试题-多窗口切换解决方案

数据探索电商平台用户行为流失分析

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

Electron pit Addon

7-2 拼题A打卡奖励 dp

There is no future to be expected. It is just the last fantasy of a migrant worker before he dies
随机推荐
Complete software development process
Opencv -- Notes
Sécurité et santé microbiennes, qu'est - ce que le traitement biologique?
静态域与静态方法
亲测有效,快速创建JMeter桌面快捷方式
TypeError: Argument ‘angle‘ can not be treated as a double
For the sustainable development of software testing, we must learn to knock code?
[无线通信基础-14]:图解移动通信技术与应用发展-2-第一代移动模拟通信大哥大
The whole process of AS400 API from zero to one
Laravel+redis generates an order number - automatically increase from 1 on the same day
Electron pit Addon
P6773 [NOI2020] 命运(dp、线段树合并)
AS400 API 从零到一的整个历程
Last day of the second quarter
How to maintain efficient collaboration in remote office and achieve stable growth of projects | community essay solicitation
7-2 punch in reward DP for puzzle a
PHP数组拼接MySQL的in语句
FL Studio20.9水果软件高级中文版电音编曲
Microbial safety and health, what is biological treatment?
go导入自建包