ButterKnife的使用详解
来源:互联网 发布:手机系统检测软件 编辑:程序博客网 时间:2024/05/22 00:40
需要依赖的包
dependencies {
//compile 'com.jakewharton:butterknife:8.8.1' //3.0之前的包
implementation 'com.jakewharton:butterknife:8.8.1' //3.0之后的包
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
3.绑定注解
@BindView---->绑定一个view;id为一个view 变量
@BindView(R.id.tv_fm1)
TextView tvFm1;
@BindViews ---->绑定多个view;id为一个view的list变量
@BindViews({ R.id.btn1,R.id.btn2 })
List<Button> buttons;
@BindArray---->绑定string里面array数组;
@BindArray(R.array.city )
String[] citys ;
@BindBitmap---->绑定图片资源为Bitmap;
@BindBitmap(R.mipmap.wifi )
Bitmap bitmap;
@BindBool ---->绑定boolean值
@BindColor ---->绑定color;
@BindColor(R.color.colorAccent)
int black;
@BindDimen ---->绑定Dimen;
@BindDimen(R.dimen.borth_width)
int mBorderWidth;
@BindDrawable ----> 绑定Drawable;
@BindDrawable(R.drawable.test_pic)
Drawable mTestPic;
@BindFloat ---->绑定float
@BindInt ---->绑定int
@BindString ---->绑定一个String id为一个String变量;
@BindString(R.string.app_name )
String meg;
- ButterKnife的使用详解
- ButterKnife的使用详解
- ButterKnife的使用详解
- ButterKnife的使用详解
- ButterKnife的配置使用详解
- butterknife的注册和使用详解
- ButterKnife v7.0.1的使用详解
- ButterKnife使用详解
- ButterKnife框架使用详解
- ButterKnife使用详解
- Butterknife使用详解
- ButterKnife使用详解
- ButterKnife使用详解
- ButterKnife使用详解
- ButterKnife使用详解
- ButterKnife框架使用详解
- ButterKnife使用详解
- ButterKnife使用详解
- Rxjava
- GPS修改,定位修改,GPS修改器,模拟GPS,虚假定位
- 自定义view轮播图
- 20171202小Dome
- json--1.概述
- ButterKnife的使用详解
- 简单自定义viewpager,小圆点控件
- Retrofit的简单使用
- GreenDao简单操作
- 题库错题簿1—10
- shiro 框架之拦截器机制
- 题库错题簿11—30
- shiro框架之JSP标签
- 如何快速实现高并发短文检索