gpt4 book ai didi

安卓工作室 :An alert box showed when I try to add RecyclerView

转载 作者:行者123 更新时间:2023-12-04 10:42:01 25 4
gpt4 key购买 nike

enter image description here

enter image description here

警告文本是:

This operation requires the library androidx.recyclerview:recyclerview:+.

Problem: Inconsistencies in the existing project dependencies found. Version incompatibility between: - androidx.appcompat:appcompat:1.1.0@aar and: - androidx.appcompat:appcompat:1.1.0@aar

With the dependency: - androidx.annotation::1.1.0 versus: - androidx.annotation::2.0.0

The project may not compile after adding this library. Would you like to add it anyway



在我选择了OK并添加了RecyclerView后,我仍然无法使用它,因为当我选择添加的RecyclerView时,它在Attributes中显示No component selected。

最佳答案

将此添加到您的 app.gradle

implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.android.support:recyclerview-v7:29.0.0'

或者您可以使用添加 Google Material Design Lib
implementation 'com.google.android.material:material:1.0.0'

所以你可以使用所有的 Material 组件,比如 CardView, SnackBar, etc
希望这会有所帮助!

关于安卓工作室 :An alert box showed when I try to add RecyclerView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59878925/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com