Skip to content
New issue

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

ButterKnife 问题 #25

Closed
maoruibin opened this issue Dec 20, 2016 · 3 comments
Closed

ButterKnife 问题 #25

maoruibin opened this issue Dec 20, 2016 · 3 comments

Comments

@maoruibin
Copy link

在 Base 类里

mUnbind = ButterKnife.bind(this);

后 为什么在 子 Activity 中

@BindView(R.id.activity_main)
FrameLayout activityMain;

activityMain 会为空,很奇怪!会是什么问题

@JessYanCoding
Copy link
Owner

必须在initData里调用,才能确保注入完毕

@maoruibin
Copy link
Author

找到原因了,Butterknife 配置姿势不对,如果是在 lib 中使用需要进行额外的配置,否则可能无法使用注解,https://github.com/JakeWharton/butterknife#library-projects

thanks for your response!

@JessYanCoding
Copy link
Owner

嗯,当前lib如果要使用必须在当前lib的build.gradle中引入apt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants