-
Notifications
You must be signed in to change notification settings - Fork 0
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
xml布局中使用include、ViewStub对换肤的影响 #8
Labels
Comments
include可行,ViewStub不支持 |
添加ViewStub换肤支持,需手动设置ViewStub的LayoutInflater: stub.setLayoutInflater(inflater); 根据ViewStub是否在Fragment中,inflater传值为Fragment/Activity的有效LayoutInflater(见 #3 )。 原理见LayoutInflater.createView(): if (view instanceof ViewStub) {
// Use the same context when inflating ViewStub later.
final ViewStub viewStub = (ViewStub) view;
viewStub.setLayoutInflater(cloneInContext((Context) args[0]));
} |
上述操作( |
ViewStub.setLayoutInflater(LayoutInflater)需要API 16才支持,低版本暂不支持ViewStub的换肤。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: