如何添加回收视图布局XML [英] How to add recycle view in layout xml
问题描述
我下面这个链接,如提及链接我想补充的循环观点如下:
I am following this link, as mentioned in the link I am trying to add recycle view as follows:
<android.support.v7.widget.RecyclerView
android:id="@+id/my_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
我已经加入 Android的支持-V7-应用程序兼容性
库项目,也尝试添加 recyclerview-v7-21.0.0-rc1.aar
到库
但还是我收到以下错误。
I have added android-support-v7-appcompat
library project and also tried adding recyclerview-v7-21.0.0-rc1.aar
to libs
but still I am getting following error.
以下类找不到:
- android.support.v7.widget.RecyclerView
请注意:我已经更新了Android SDK工具,SDK的Android平台工具,Android SDK中生成工具,Android的L(API 20,L preVIEW)
Note: I have updated Android SDK Tools, Android SDK Platform Tools, Android SDK Build Tools, Android L (API 20, L Preview)
请帮助..
推荐答案
您不能添加AAR文件在Eclipse中libs文件夹(它不是一个jar文件)
You can't add the aar file to libs folder in Eclipse (it isn't a jar file)
最好的办法新RecyclerView工作是,目前,切换到 Android的工作室并添加这种依赖你的build.gradle
The best way to work with the new RecyclerView is, currently, to switch to Android Studio and add this dependency to your build.gradle
compile 'com.android.support:recyclerview-v7:+'
刚一说明。这是不使用'+'占位符一个很好的做法,但在这种情况下,你正在尝试preVIEW发布,所以这将是更新很快与稳定释放。
Just a note. It is not a good practice to use the '+' placeholder, but in this case you are trying a preview release, so it will be update soon with stable release.
当然,你还可以使用Eclipse,但它会需要一些手动操作。
检查此链接:
<一href=\"http://happily$c$cd.com/blog/using-recyclerview-and-cardview-in-eclipse-adt/\">http://happily$c$cd.com/blog/using-recyclerview-and-cardview-in-eclipse-adt/
Of course you can still use Eclipse but it will requires some manual operations. Check this link: http://happilycoded.com/blog/using-recyclerview-and-cardview-in-eclipse-adt/
这篇关于如何添加回收视图布局XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!