menuSection icon image compatibility

This commit is contained in:
TrueZhuanjia committed 2025-06-10 20:24:35 +08:00
1 parent 5c3a6de2b7
commit 79a075e338
8 files changed
+120 -17

No files matched your search

+7 -3
View File
@@ -200,13 +200,17 @@
- (void)setSectionWithIcon:(UIImage *)icon andSize:(CGFloat)size{
if (@available(iOS 13.0, *)) {
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithPointSize:size weight:UIImageSymbolWeightBold];
UIImageSymbolConfiguration *config;
if(icon.isSymbolImage) config = [UIImageSymbolConfiguration configurationWithPointSize:size weight:UIImageSymbolWeightBold];
else{
config = [UIImageSymbolConfiguration configurationWithPointSize:size];
icon = [icon imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
}
_iconImageView.image = [icon imageWithConfiguration:config];
} else {
_iconImageView.image = icon;
}
_iconImageView.tintColor = [ThemeManager textColor];
_iconImageView.hidden = (icon == nil);
[self updateLayout];
}