Tencent / QMUI_iOS

QMUI iOS——致力于提高项目 UI 开发效率的解决方案
http://qmuiteam.com/ios
Other
7.11k stars 1.39k forks source link

iOS17系统切换主题时图片不会变化 #1537

Open ihaodi opened 10 months ago

ihaodi commented 10 months ago

Bug 表现 UIImage imge = [UIImage qmui_imageWithName:_name themeProvider:^UIImage _Nonnull(kindof QMUIThemeManager _Nonnull manager, __kindof NSObject _Nullable identifier, kindof NSObject * _Nullable theme) { return [UIImage imageNamed:[identifier isEqualToString:QDThemeIdentifierDark] ? [_name stringByAppendingString:@"_dark"] : [_name stringByAppendingString:@"_light"]]; }]; [mobleBtn setImage:imge forState:0];

图片未改变

预期的表现 正常情况下,应该是什么表现

其他信息

DarrenKong commented 10 months ago

你可以试一下这个: UIImage image = [UIImage qmui_imageWithName:_name themeProvider:^UIImage _Nonnull(kindof QMUIThemeManager _Nonnull manager, __kindof NSObject _Nullable identifier, kindof NSObject * _Nullable theme) { return [identifier isEqualToString:QDThemeIdentifierDark] ? [UIImage imageNamed:[_name stringByAppendingString:@"_dark"]] : [UIImage imageNamed:[_name stringByAppendingString:@"_light"]]; }]; [mobileBtn setImage:image forState:0];