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

只支持静态视图 ,动态加载的视图将无效,如ViewStub,所有根据异步数据生成的View等 #3

Open
zlrab opened this issue Oct 10, 2020 · 2 comments

Comments

@zlrab
Copy link

zlrab commented Oct 10, 2020

No description provided.

@long8313002
Copy link
Owner

代码生成的视图,没办法生效的

@zlrab
Copy link
Author

zlrab commented Oct 15, 2020

可以做到 你是在ActivityLifecycleCallbacks的onActivityCreated()hook了layoutInflater,这样就局限在setContentView()的布局上,View提供了addOnLayoutChangeListener()方法 在将View绑定到视图上是都会走这个回调 可以在这个里面做hook逻辑 不过要解决重复hook造成的资源浪费问题

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