DrawerLayout是Library包中实现了侧滑菜单效果的控件,drawerLayout分为侧边菜单和主内容区两部分,侧边菜单可以根据手势展开与隐藏(drawerLayout自身特性),
一定要导入包
布局
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/draw"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="45dp"
app:tabMode="scrollable"
android:id="@+id/tab_layout"
>
</android.support.design.widget.TabLayout>
<android.support.v4.view.ViewPager
and