Android导航组件中的FragmentContainerView重复
我正在使用jetpack导航创建单个活动应用程序。一切正常。我有一个要求,使一些片段全屏 这是我的布局xmlAndroid导航组件中的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=&
<?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
谁能给我解释一下吗?提前谢谢。我也遇到了同样的问题,根本不知道问题的原因。奇怪的是,这个问题没有任何互动。你发现了新的东西吗?