如何将DrawerLayout添加到android中的mainActivity.xml中

时间:2015-04-07 05:44:26

标签: android fragment drawerlayout

现在我的mainActivity.xml文件如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="#FFFFFF"
              android:orientation="vertical">

    <include layout="@layout/title_bar" />
    <FrameLayout android:id="@+id/tab_content"
                 android:layout_width="match_parent"
                 android:layout_height="0dp"
                 android:layout_weight="1" />

    <include layout="@layout/bottom_bar" />

</LinearLayout>

这个页面底部有四个标签,每个标签都与一个不同的片段相关联,这些片段将被添加到android:id =&#34; @ + id / tab_content&#34;。

以下是我的问题,如何将DrawerLayout添加到mainActivity.xml中,并且只允许第一个片段打开抽屉布局。

0 个答案:

没有答案