Android开发

安卓ButterKnife基本用法

2021-04-07  本文已影响0人  DannyStone

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
上一篇 下一篇

猜你喜欢

热点阅读