菜单:添加多个功能选项 布局。
流行的侧滑。
DrawerLayout:支持拖动显示或者隐藏 内容的控件。 V4的控件。
FrameLayout:
谷歌提供的支持侧滑菜单的一个布局 。提供一个兼容包v4
1.布局 页面内容 菜单内容
2.DrawerLayout包裹这两块布局
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<!-- 页面 -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<include layout="@layout/activity_main"/>
</FrameLayout>
<!-- 菜单 -->
<FrameLayout
android:layout_width="200dp"
android