基本配置
在android Studio项目中配置使用ButterKnife
Step one:在Project的 build.gradle 中添加如下代码:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1' //添加这一行
}
}
1
dependencies中添加:
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
1
/**
* onDestroyView中进行解绑操作
*/
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
}
2
构建环境特别简单,接下来看看如何使用
请你别懒,看了这个链接你不会后悔
注:
https://note.youdao.com/share/?id=86a1da87737aae2d81d63b57ffcbf17f&type=notebook#/4B2F233D914641C9896388D948354A58