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系统切换主题时图片不会变化 #1537

Open
ihaodi opened this issue Dec 13, 2023 · 1 comment
Open

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

ihaodi opened this issue Dec 13, 2023 · 1 comment

Comments

@ihaodi
Copy link

ihaodi commented Dec 13, 2023

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];

图片未改变

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

其他信息

  • 设备: [例如模拟器、iPhone、iPad]
  • iOS 版本: [iOS 17.1.2]
  • Xcode 版本: [Xcode 15.x]
  • QMUI 版本: [4.7.0]
@DarrenKong
Copy link

你可以试一下这个:
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];

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