We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
1.通过注解器在编译期间生成一个XX_ViewBinding.java文件(XX可以是activity,fragment,adapter,dialog),这个文件这么生成的? 注解器里会添加需要类型的注解; 查找XX类中的特定类型注解,如果有,拼接成字符串,创建并写到XX_ViewBinding.java文件中 2.XX_ViewBinding.java会持有XX的引用, 如果是初始化控件,通过xx.findViewById实现 如果是设置监听,类似xx.setOnClickListener实现 3.XX类中初始化XX_ViewBinding对象,这样打通了整个流程
Sorry, something went wrong.
注解技术,在编译阶段生成java代码 (1)开始它会扫描java代码中所有的ButterKnife注解 onbindview onclickVIew (2)ButterknifeProcessor ->$$ViewBinder (3)调用bind方法加载生成的ViewBInderl类
使用ButterKnife是为了简化代码 通过注解代替findViewById ButterKnife是在编译时注解 不会影响APP的效率和性能 ButterKnife的实现原理是通过注解和注解器对每个Activity生成一个相对应的类 把原本需要findViewById和点击事件利用注解生成代码
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: