我使用了 RecycleView 的实现
'com.google.android.material:material:1.0.0'
。在布局中,当我输入“回收”时,它给出的建议为 androidx.appcompat.app.AlertController$RecycleListView
,这不是我想要的。
即使我输入这个
androidx.recyclerview.widget.RecyclerView
,它也能工作,但它不允许使用诸如 id、高度、宽度等属性。一个月前它工作得很好,就像它给出了正确的建议一样,现在它完全没有在 RecycleView 中显示。有没有人有解决办法?
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
更新
这是我的
build.gradle
中一些库的列表:
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
另请参阅支持库中的RecyclerView在哪里?和如何导入适用于Android L-preview的RecyclerView。
1.Open build.gradle and add recycler view dependency.
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
2. left corner of this file sync now option and click on it.
3. in xml file you can add below code:
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/listing"
android:layout_width="match_parent"
android:layout_height="match_parent" />