但是绑定
@BindView(R.id.phone_btn)
Button phoneBtn;
@BindView(R.id.alum_btn)
Button alumBtn;
@BindString(R.string.app_name)
String appName;
在ButterKnife.bind(this)之后得到appName和phoneBtn,alumBtn都为null
为什么会这样呢?
发现需要在Module的build.gradle里加上以下红色的内容
dependencies {
compile fileTree(dir: ‘libs‘, include: [‘*.jar‘])
compile ‘com.android.support:appcompat-v7:23.4.0‘
compile ‘com.jakewharton:butterknife:8.4.0‘
annotationProcessor ‘com.jakewharton:butterknife-compiler:8.4.0‘
compile ‘com.android.support:support-v4:23.4.0‘
}