无法解析 Butterknife 中的符号 BindViews
Can't resolve symbol BindViews in Butterknife
我正在使用 Butterknife 绑定一个 views.When 绑定组多个视图
像 Acting on Multiple Views In a List , @BindViews
不可用。见下图:
我正在尝试以下代码:
@BindViews({ R.id.edtOne, R.id.edtTwo, R.id.edtThree })
List<EditText> editTextsList;
我该如何解决?
确保更新到最新版本的 ButterKnife:
版本 8.0.0 (2016-04-25)
@Bind becomes @BindView and @BindViews (one view and multiple views, respectively).
从Version 7.0.0
改过来了。
@Bind
替换了 @InjectView
和 @InjectViews
。 ButterKnife.bind
和 ButterKnife.unbind
分别替换了 ButterKnife.inject
和 ButterKnife.reset
。
看看这个参考资料Link。
从Version 8.0.0
.
运行时和编译器现在分为两个工件。
compile 'com.jakewharton:butterknife:8.0.0'
apt 'com.jakewharton:butterknife-compiler:8.0.0'
看看这个Link还有
在应用模块中试用
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
我正在使用 Butterknife 绑定一个 views.When 绑定组多个视图
像 Acting on Multiple Views In a List , @BindViews
不可用。见下图:
我正在尝试以下代码:
@BindViews({ R.id.edtOne, R.id.edtTwo, R.id.edtThree })
List<EditText> editTextsList;
我该如何解决?
确保更新到最新版本的 ButterKnife:
版本 8.0.0 (2016-04-25)
@Bind becomes @BindView and @BindViews (one view and multiple views, respectively).
从Version 7.0.0
改过来了。
@Bind
替换了 @InjectView
和 @InjectViews
。 ButterKnife.bind
和 ButterKnife.unbind
分别替换了 ButterKnife.inject
和 ButterKnife.reset
。
看看这个参考资料Link。
从Version 8.0.0
.
运行时和编译器现在分为两个工件。
compile 'com.jakewharton:butterknife:8.0.0'
apt 'com.jakewharton:butterknife-compiler:8.0.0'
看看这个Link还有
在应用模块中试用
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'