DrawerLayout占用全屏宽度,无法滑动

时间:2018-12-18 08:11:12

标签: java android navigation-drawer drawerlayout androidx

我正在使用androidx和新的"com.google.android.material:material:1.0.0",但是DrawerLayout无法正常工作。它需要全屏宽度,而Im甚至无法滑动。检查附件enter image description here

下面是我的简单布局:

<androidx.drawerlayout.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/drawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".activities.DrawerActtivity"

    >
    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
    <com.google.android.material.navigation.NavigationView
        android:id="@+id/navigationView"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        app:itemTextColor="@color/navigation_item_selection"
        app:itemIconTint="@color/navigation_item_selection"
        app:menu="@menu/drawer_menu"

        />

</androidx.drawerlayout.widget.DrawerLayout>

我使用support库检查我的其他项目及其相同项目。我认为问题在于这些新的素材库

0 个答案:

没有答案
相关问题