我尝试了不同的版本,当我按下“同步”时,仅使用“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'

梵蒂冈之花
TA贡献1900条经验 获得超5个赞
使用android studio提供的Navigation Drawer Activity
右键单击主文件夹 -> 新建 -> 活动 -> 导航抽屉活动
添加回答
举报
0/150
提交
取消