配置了butterknife 没有报错,但是控件绑定和点击均无效。
问题原因:
butterknife配置不完善问题导致。
解决办法:
找到app的module的build.gradle
dependencies { compile fileTree(dir: ‘libs‘, include: [‘*.jar‘]) androidTestCompile(‘com.android.support.test.espresso:espresso-core:2.2.2‘, { exclude group: ‘com.android.support‘, module: ‘support-annotations‘ }) 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‘ testCompile ‘junit:junit:4.12‘ compile ‘de.greenrobot:eventbus:3.0.0-beta1‘ compile ‘com.tbruyelle.rxpermissions:rxpermissions:[email protected]‘ }
时间: 2024-12-27 17:05:06