Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android导航组件中的FragmentContainerView重复_Android_Android Architecture Navigation_Android Navigation - Fatal编程技术网

Android导航组件中的FragmentContainerView重复

Android导航组件中的FragmentContainerView重复,android,android-architecture-navigation,android-navigation,Android,Android Architecture Navigation,Android Navigation,我正在使用jetpack导航创建单个活动应用程序。一切正常。我有一个要求,使一些片段全屏 这是我的布局xml <?xml version="1.0" encoding="utf-8"?> <androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app=&

我正在使用jetpack导航创建单个活动应用程序。一切正常。我有一个要求,使一些片段全屏

这是我的布局xml

<?xml version="1.0" encoding="utf-8"?>
<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/main_drawer"
    android:fitsSystemWindows="true"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?attr/colorSurface"
    tools:context=".features.HomeActivity">

    <androidx.fragment.app.FragmentContainerView
        android:id="@+id/main_nav_container"
        android:name="androidx.navigation.fragment.NavHostFragment"
        android:fitsSystemWindows="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:defaultNavHost="true"
        app:navGraph="@navigation/main_navigation" />

    <com.google.android.material.navigation.NavigationView
        android:id="@+id/navigation_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:headerLayout="@layout/main_header"
        app:itemShapeInsetStart="0dp" />


</androidx.drawerlayout.widget.DrawerLayout>

这造成的问题是,第一个
FragmentContainerView
fitsSystemWindows
属性设置为true,但第二个
FragmentContainerView
未设置该属性。我还尝试了并检查了视图,它还有重复的
FragmentContainerView


谁能给我解释一下吗?提前谢谢。

我也遇到了同样的问题,根本不知道问题的原因。奇怪的是,这个问题没有任何互动。你发现了新的东西吗?