[英]Why can't I import LinearLayoutManager and RecyclerView?
I can import everything else from the Android library except for those two. 除了这两个,我可以从Android库导入其他所有内容。 I'm trying to import them from
android.support.v7.widget
which doesn't work, but importing fragment and activity classes from android.support.v4.widget
does work. 我试图从
android.support.v7.widget
导入它们不起作用,但从android.support.v4.widget
导入片段和活动类确实有效。
My Gradle Build looks like this: 我的Gradle Build看起来像这样:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.frisosapps.planner"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:support-v4:22.2.1'
}
Should I add something to this or should I look for the cause elsewhere? 我应该为此添加一些东西还是应该在其他地方寻找原因?
要使用RecyclerView
,请使用compile 'com.android.support:recyclerview-v7:23.1.1'
您需要将RecyclerView依赖项作为其独立库包含在内
compile "com.android.support:recyclerview-v7:23.1.1"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.