我尝试在布局xml中添加RecylerView
:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<android.support.v7.widget.RecylcerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" >
</android.support.v7.widget.RecylcerView>
</RelativeLayout>
但是有这个错误:
找不到以下类: android.support.v7.widget.RecylcerView(修复构建路径,编辑XML, 创建类)
我做完了:
但错误仍然存在。
注意:&#34;请回复Eclipse,而不是Android Studio&#34;
答案 0 :(得分:4)
转到C:\Users\Hk-PC\Desktop\eclipse\adt-bundle-windows-x86-20140702\sdk\extras\android\m2repository\com\android\support\recyclerview-v7\22.1.1
使用Winrar打开recyclerview-v7-22.1.1.aar
文件。
有一个名为classes.jar
的jar文件。将其复制到项目libs文件夹。
右键单击classes.jar
,添加到构建路径。
就是这样。它对我有用。希望它也适合你。
答案 1 :(得分:0)
您是否在实际的模拟器或Android手机中编译和使用了RecyclerView?我认为这是渲染库的一个问题。它在Android Studio中对我来说是一样的。
答案 2 :(得分:0)
您将通过转到\ android-sdk \ extras \ android \ support \ v7 \ recyclerview和Chcek将Recycler视图作为项目导入您的工作区通过转到其属性android,它是否标记为库,如果没有将其标记为库将其添加到项目中作为库,转到项目属性添加。
如果你已经完成了这件事,那么打开Android sdk并检查ndroid支持库版本不应该是21,因为它有一些bug,所以更新到版本22。