为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

有只小跳蛙 2023-08-09 16:17:08
我尝试了不同的版本,当我按下“同步”时,仅使用“androidx.appcompat:appcompat:1.1.0”,但使用这个版本时我无法使用NavigationView。
查看完整描述

2 回答

?
叮当猫咪

TA贡献1776条经验 获得超12个赞

在 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'


查看完整回答
反对 回复 2023-08-09
?
梵蒂冈之花

TA贡献1900条经验 获得超5个赞

使用android studio提供的Navigation Drawer Activity

右键单击主文件夹 -> 新建 -> 活动 -> 导航抽屉活动


查看完整回答
反对 回复 2023-08-09
  • 2 回答
  • 0 关注
  • 100 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信