2015-01-07 4 views
3

Android 앱에서 RecyclerView를 사용하고 싶습니다. 속성은 다음과 같습니다 이전 버전의 Android에서 RecyclerView 사용

minSdkVersion="14" (ICS) 
compile sdk version="21" (L) 
Target sdk version="14" (ICS) 

나는 build.gradle 파일 종속성에서 compile 'com.android.support:appcompat-v7:21.0.3'을 추가했다. 나는 XML에 RecyclerView을 추가 해요 때, 나는 오류 다음 납니다 :

The following classes could not be found: 
- android.support.v7.widget.RecyclerView (Fix Build Path, Create Class) 

XML 코드 :

<android.support.v7.widget.RecyclerView 
     android:id="@+id/my_recycler_view" 
     android:scrollbars="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"/> 

내가 원하는 ICS 위의 모든 장치에서 실행할 수있는 응용 프로그램입니다. 이 문제를 해결할 때 도와주세요.

답변

3

build.gradleRecyclerView V7 지원 라이브러리를 추가합니다. 특정 기능에 대해 각각 v7 라이브러리가 여러 개 있습니다.

compile 'com.android.support:recyclerview-v7:21.0.3'

+0

@ Jaguar 당신은'appcompat' v7 라이브러리를 추가했다. – steve

+0

고마워. 이 후 libs에 jar 파일을 추가해야합니까? – Jaguar

+0

@Jaguar no, 위에서 설명한 줄에서 jar 및 리소스를 가져옵니다. – steve

0

RecyclerView는 자신의 라이브러리에 있습니다

compile 'com.android.support:recyclerview-v7:21.0.3' 
0
targetSdkVersion 25/compileSdkVersion 25를 들어

하고 'com.android.support:recyclerview-v7:25.3.1'

버전을 컴파일 사용할 필요가 'com.android.support:appcompat-v7:25.3.1'을 컴파일은 동일해야합니다.

관련 문제