环境说明:
IDE : Android Studio 4.1.1
语言: kotlin 1.4.21
依赖库版本: Androidx Navigation 2.2.2
有如下布局文件:
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/my_nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
app:navGraph="@navigation/nav_sample"
app:defaultNavHost="true" />
<android.support.design.widget.NavigationView
android:layout_width="wrap_content"
android:layout_height="matc

本文介绍在Android Studio 4.1.1中使用Androidx Navigation 2.2.2时遇到的NavController查找问题,并提供了解决方案。


被折叠的 条评论
为什么被折叠?



