Android Butterknife使用方法總結

相關文章:Android Butterknife使用方法總結

ButterKnife使用方法詳解

基本配置
在android Studio項目中配置使用ButterKnife

  • Step one:在Project的 build.gradle 中添加如下代碼:

 

dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1'  //添加這一行

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
  • Step two:在App的 build.gradle 中添加如下代碼:

apply plugin: 'com.jakewharton.butterknife'
  • dependencies中添加:

//butterknife
    compile 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章