【UI】NavigationView使用:

来源:互联网 发布:大连嘉友软件 编辑:程序博客网 时间:2024/06/05 04:04

是谷歌在侧滑的MaterialDesign的一种规范,所以提出了一个新的控件,用来规范侧滑的基本样式。
DrawerLayout+ NavigationView结合使用
只是对侧滑的规范;

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:layout_width="match_parent"    android:layout_height="match_parent"    tools:context=".ui.activity.MainActivity">    <include layout="@layout/activity_main_content"/>    <android.support.design.widget.NavigationView        android:layout_width="wrap_content"        android:layout_height="match_parent"        android:layout_gravity="left"        android:fitsSystemWindows="true"        app:headerLayout="@layout/navigation_headerlayout"        app:menu="@menu/navigation_menu"/></android.support.v4.widget.DrawerLayout>
原创粉丝点击