1.导入BufferKnife包
implementation'com.jakewharton:butterknife:10.2.1'
annotationProcessor'com.jakewharton:butterknife-compiler:10.2.1'
导入前需确定java版本
compileOptions{
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
2.修改界面TextView功能
使用ButterKnife一定要加 ButterKnife.bind(this);
3.添加Button点击事件功能
4.添加多个Button点击事件
5.读取EditText
6.页面跳转
跳转点击事件新页面 在androidmainfest中添加activity
网友评论