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

解决iOS17切换主题后图片没有更新的问题。 #1514

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion QMUIKit/QMUIComponents/QMUITheme/UIView+QMUITheme.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,17 @@ - (void)qmui_themeDidChangeByManager:(QMUIThemeManager *)manager identifier:(__k
BOOL isValidatedEffect = [value isKindOfClass:QMUIThemeVisualEffect.class] && (!manager || [((QMUIThemeVisualEffect *)value).managerName isEqual:manager.name]);
BOOL isOtherObject = ![value isKindOfClass:UIColor.class] && ![value isKindOfClass:UIImage.class] && ![value isKindOfClass:UIVisualEffect.class];// 支持所有非 color、image、effect 的其他对象,例如 NSAttributedString
if (isOtherObject || isValidatedColor || isValidatedImage || isValidatedEffect) {
[self performSelector:setter withObject:value];
if (@available(iOS 17.0, *)) {
if ([self isKindOfClass:[UIImageView class]] && [setterString isEqualToString:@"setImage:"]) {
UIImageView *imageView = (UIImageView *)self;
imageView.image = nil;
imageView.image = value;
} else {
[self performSelector:setter withObject:value];
}
} else {
[self performSelector:setter withObject:value];
}
}
EndIgnorePerformSelectorLeaksWarning
}];
Expand Down