Android 笔记 CoordinatorLayout

来源:互联网 发布:网络在线客服 编辑:程序博客网 时间:2024/05/15 06:43
  • CoordinatorLayout

Android 官方 抽屉布局

截取官方例子中布局代码

include的布局为底层布局

后面navigationview 为抽屉,即拉出来的那一层

<?xml version="1.0" encoding="utf-8"?><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">    <include layout="@layout/app_bar_mao"        android:layout_width="match_parent"        android:layout_height="match_parent" />    <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_mao"            app:menu="@menu/activity_mao_drawer" /></android.support.v4.widget.DrawerLayout>

12
2为抽屉效果

更多详细

http://blog.csdn.net/xyz_lmn/article/details/48055919

0 0
原创粉丝点击