版本8.8.0中不推荐使用ButterKnife findByID方法

Nar*_*yan 13 android butterknife

嗨,我刚刚更新了ButterKnife库版本8.7.0到8.8.0

compile 'com.jakewharton:butterknife:8.8.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.0'
Run Code Online (Sandbox Code Playgroud)

并发现:

findById(view, id);
Run Code Online (Sandbox Code Playgroud)

不推荐使用,为什么?用什么方法代替?但是当将版本恢复为8.7.0(或更早版本)时,不推荐使用的警告会消失.

compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
    applicationId "com.some.app"
    minSdkVersion 21
    targetSdkVersion 25
...
Run Code Online (Sandbox Code Playgroud)

Jak*_*ton 37

根据更改日志:

弃用  findById方法.针对API 26进行编译,并使用findViewById 相同功能的法线  .

Android findViewById已经更新,在API 26中具有相同的功能,最近变得稳定,因此允许Butter Knife的版本在即将发布的v9.0中被弃用和删除.