猿问

我想在我的应用程序中使用 NavigationView,但找不到为 androidX 实现的正确依

我尝试了不同的版本,当我按下“同步”时,仅使用“androidx.appcompat:appcompat:1.1.0”,但使用这个版本时我无法使用NavigationView。



有只小跳蛙
浏览 101回答 2
2回答

叮当猫咪

在 Gradle 中添加此代码并同步implementation 'androidx.appcompat:appcompat:1.1.0'implementation 'com.google.android.material:material:1.0.0'implementation 'androidx.constraintlayout:constraintlayout:1.1.3'implementation 'androidx.navigation:navigation-fragment:2.1.0'implementation 'androidx.navigation:navigation-ui:2.1.0'implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'testImplementation 'junit:junit:4.12'androidTestImplementation 'androidx.test:runner:1.2.0'androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

梵蒂冈之花

使用android studio提供的Navigation Drawer Activity右键单击主文件夹 -> 新建 -> 活动 -> 导航抽屉活动
随时随地看视频慕课网APP

相关分类

Java
我要回答