黄油刀使用方法(butterknife)
来源:互联网 发布:mac os 光盘镜像 编辑:程序博客网 时间:2024/04/28 20:45
使用心得:
1.Activity ButterKnife.bind(this);必须在setContentView();之后,且父类bind绑定后,子类不需要再bind
2.Fragment ButterKnife.bind(this, mRootView);
3.属性布局不能用private or static 修饰,否则会报错
4.setContentView()不能通过注解实现。(其他的有些注解框架可以)
开源项目:
http://jakewharton.github.io/butterknife/注解方式 找到控
0。下载插件
1.
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
2.
apply plugin: 'com.neenbedankt.android-apt'
3.
compile 'com.jakewharton:butterknife:8.4.0'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
使用
鼠标点中布局文件
nice !!!!!!!
使用github上面有详细的介绍,但是要注意gradle文件是项目还是模块
0 0
- 黄油刀使用方法(butterknife)
- Android Butterknife(黄油刀) 使用方法总结
- Butterknife(黄油刀)简单用法
- butterknife----黄油刀
- 黄油刀 Butterknife 8.4.0
- 【Android 进阶】ButterKnife-黄油刀
- butterknife 黄油刀 学习记录
- 黄油刀butterknife Android studio
- Android中ButterKnife(黄油刀)的详细使用
- Android神兵利器之黄油刀(ButterKnife)
- 最新Android 黄油刀(Butterknife)的简单使用
- Butterknife(黄油刀使用)一分钟集成
- Android Studio 结合 ButterKnife Zelezny 高效使用 Butterknife(黄油刀)
- Android Butterknife黄油刀的配置
- Android框架之ButterKnife(黄油刀)
- 【butterknife】butterknife:8.4.0 黄油刀使用详解。
- ButterKnife(黄油刀)的使用(Eclipse和Android Studio)
- 黄油刀butterknife在Library上的使用(元素值必须为常量表达式)
- Spark的四种运行模式(1.2.1)
- 加快maven中jar包的下载速度
- Java学习笔记(2)
- Java使用Velocity模板发送HTML格式邮件并解决中文乱码问题
- P1789【Mc生存】插火把
- 黄油刀使用方法(butterknife)
- Codeforces 586C Gennady the Dentist【模拟】
- anaconda 中安装seaborn ,plotly,jieba
- Linux socket编程中阻塞和非阻塞
- div仿框架布局
- Android Notification 使用
- 股票入门基础知识31:日本蜡烛图——十字线形态
- Eclipse界面的中英文显示修改的方法
- 获取所有被禁用的input和select