CardView for android无法导入

问题描述 投票:6回答:2

我从中获取了Card View的jar文件

sdk\extras\android\m2repository\com\android\support\cardview-v7\21.0.0-rc1

我试过这个link1link2的例子

我能够为Recycler做,但是对于卡片视图,它在xml中显示错误,用于在XML布局中导入android.support.v7.widget.CardView

而详细的错误是

error: No resource identifier found for attribute 'cardCornerRadius' in package 'com.cards.cardlayoutui'
android cardlayout
2个回答
0
投票

尝试添加值xml文件,并按照本教程可能会有所帮助

http://treyrobinson.net/blog/android-l-tutorials-part-3-recyclerview-and-cardview/


0
投票

请参阅我在GitHub上的帖子:https://github.com/lt-tibs1984/CardViewLibrary这将指导您完成如何使用此项目,并使用下载的SDK for CardView。今晚我会尽快更新这个。

基本上,问题是当您解压缩zip文件并仅导入jar文件时,您没有与卡视图关联的资源。

只需下载我的zip文件,将其作为现有代码导入工作区,然后将classes.jar添加为库依赖项!

阅读中的方向可用

更新

这个答案的原始项目既不相关也不存在。

要在项目中使用Cardview,

implementation 'com.android.support:cardview-v7:28.0.0'

或者如果使用androidx:

implementation 'androidx.cardview:cardview:1.0.0'

到你的应用程序的build.gradle

© www.soinside.com 2019 - 2024. All rights reserved.