如何导入RecyclerView

roa_finder 2016-10-03 10:35:08
我的build.gradle中没有dependens 如下:(如何添加compile android.support.v7-recyclerView)
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
...全文
513 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
weimengfeiwu 2017-03-29
  • 打赏
  • 举报
回复
compile 'com.android.support:design:24.1.1'导入这个,再试一下
xingfeng_coder 2016-10-11
  • 打赏
  • 举报
回复
3楼的方法比较android studio
异想·天开 2016-10-11
  • 打赏
  • 举报
回复
导入 compile 'com.android.support:design:24.1.1' 把版本号改一下
wslqm123 2016-10-06
  • 打赏
  • 举报
回复
点击 file -> project structure 选中 modules 下你的项目,在右边的选项卡里面选择 dependencies 点击最右侧的 + 号选第一个,输入recyclerView回车,选中下面提示的结果点击 ok ,build.gradle中就会自动添加依赖了
小小亠星辰 2016-10-03
  • 打赏
  • 举报
回复
有两个build.grade你打开另外一个试试
roa_finder 2016-10-03
  • 打赏
  • 举报
回复
apply plugin: 'com.android.application' android { compileSdkVersion 24 buildToolsVersion "24.0.3" defaultConfig { applicationId "com.example.administrator.test1" minSdkVersion 24 targetSdkVersion 24 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:24.2.1' testCompile 'junit:junit:4.12' } 这是另外一个gradle(app)的代码 导入 compile'com.android.support:recyclerview-v7:24.2.1' 会报错

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧