为什么我的导航抽屉没有出现?(只有汉堡包图标)

菲塔勋爵

嗨,我正在做一个滑动选项卡,如果您向上滑动,工具栏将立即隐藏,我正在放置导航抽屉。我的导航抽屉没有出现,只有汉堡包图标出现了。但是如果我要把抽屉的关闭标签放在查看寻呼机的下面。抽屉可以正常工作,但是不会出现在回收者视图中的列表。我认为我的xml上有问题,否则放置不匹配。有什么建议?这是我的activity_main.xml

activity_main.xml

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


    <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/coordinatorLayout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">


        <android.support.v4.widget.DrawerLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:layout_height="match_parent"
            android:layout_width="match_parent"
            android:id="@+id/drawerLayout"
            >

            <FrameLayout
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:id="@+id/containerView">
            </FrameLayout>

            <android.support.design.widget.NavigationView
                xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_gravity="start"
                android:id="@+id/shitstuff"
                app:itemTextColor="@color/black"
                app:menu="@menu/drawermenu"
                android:layout_marginTop="-24dp" />

        </android.support.v4.widget.DrawerLayout>
        <!-- AppBar Layout   -->
        <android.support.design.widget.AppBarLayout

            android:id="@+id/appBarLayout"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="fill_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="?attr/colorPrimary"
                app:layout_scrollFlags="scroll|enterAlways"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                android:title="Android Testing"/>
            <!-- Tab Layout for creating tabs -->
            <android.support.design.widget.TabLayout
                android:id="@+id/tabs"
                app:tabGravity="fill"
                app:tabMode="fixed"
                android:background="@color/material_blue_grey_800"
                app:tabIndicatorColor="@color/main_color"
                app:tabSelectedTextColor="@color/main_color"
                app:tabTextColor="@color/white"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

            </android.support.design.widget.TabLayout>
        <!-- Helps handing the Fragments for each Tab -->
        </android.support.design.widget.AppBarLayout>

        <android.support.v4.view.ViewPager
            android:id="@+id/viewPager"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    </android.support.design.widget.CoordinatorLayout>

</LinearLayout>
侯赛因ID

尝试这个:

    <?xml version="1.0" encoding="utf-8"?>

<android.support.v4.widget.DrawerLayout
    android:id="@+id/drawerLayout"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        android:orientation="vertical">


        <android.support.design.widget.CoordinatorLayout android:id="@+id/coordinatorLayout"
                                                         xmlns:android="http://schemas.android.com/apk/res/android"
                                                         xmlns:app="http://schemas.android.com/apk/res-auto"
                                                         android:layout_width="fill_parent"
                                                         android:layout_height="fill_parent">


            <FrameLayout
                android:id="@+id/containerView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">
            </FrameLayout>

            <android.support.design.widget.AppBarLayout

                android:id="@+id/appBarLayout"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

                <android.support.v7.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="fill_parent"
                    android:layout_height="?attr/actionBarSize"
                    android:background="?attr/colorPrimary"
                    android:title="Android Testing"
                    app:layout_scrollFlags="scroll|enterAlways"
                    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
                <!-- Tab Layout for creating tabs -->
                <android.support.design.widget.TabLayout
                    android:id="@+id/tabs"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@color/material_blue_grey_800"
                    app:tabGravity="fill"
                    app:tabIndicatorColor="@color/main_color"
                    app:tabMode="fixed"
                    app:tabSelectedTextColor="@color/main_color"
                    app:tabTextColor="@color/white">

                </android.support.design.widget.TabLayout>
                <!-- Helps handing the Fragments for each Tab -->
            </android.support.design.widget.AppBarLayout>

            <android.support.v4.view.ViewPager
                android:id="@+id/viewPager"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

        </android.support.design.widget.CoordinatorLayout>

    </LinearLayout>


    <android.support.design.widget.NavigationView
        android:id="@+id/shitstuff"
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:layout_marginTop="-24dp"
        app:itemTextColor="@color/black"
        app:menu="@menu/drawermenu"/>

</android.support.v4.widget.DrawerLayout>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

为什么我的 android 应用程序中的汉堡包图标不起作用它没有打开导航菜单?

更改导航抽屉汉堡包图标

使用带有导航组件的导航抽屉时如何更改操作栏图标(汉堡包图标)

为什么导航抽屉没有出现

颤振导航抽屉汉堡包图标颜色更改

为什么我的彩色图标没有显示在导航抽屉中

单击工具栏上的汉堡包图标不会打开导航抽屉

在Android中打开导航抽屉时,将“汉堡包”操作栏图标更改为“旋转箭头”无效

工具栏导航“汉堡包”图标丢失

Bootstrap,汉堡包图标在导航栏中不响应

如何禁用“汉堡包”图标变为错误(导航组件)

为什么蚂蚁设计抽屉没有显示关闭图标?

为什么我的抽屉导航器屏幕没有使用嵌套的标题标题(StackNavigator,DrawerNavigator)

为什么导航抽屉,没有lintening MenuItem点击?

我的菜单不再显示汉堡包图标

带有Bootstrap 2.x中的汉堡包图标的居中徽标

初次点击后,“汉堡包”按钮没有关闭

如何通过单击本机标题中的汉堡包图标打开抽屉?

导航抽屉汉堡图标丢失

为什么我的字形图标没有显示在导航栏上(引导程序)?

当我单击汉堡包图标时,该图标与关闭图标重叠。单击时如何删除汉堡包图标,以便可以显示关闭图标

为什么我的导航栏没有出现在我的网站上?

汉堡包图标加载为“X”

xamarin.forms 汉堡包图标

为什么我的分区没有出现?

使用带有jetpack导航组件的导航抽屉时如何更改工具栏图标(汉堡图标)

为什么在单击汉堡并展开窗口后导航栏没有重置?

Bootstrap导航栏:调整导航栏高度后,汉堡包出现问题

将徽章计数器添加到Android中的汉堡包导航菜单图标