fix:修正切换语言后 tabbar 显示顺序不正确问题

This commit is contained in:
edwinQQQ
2024-11-28 11:05:57 +08:00
parent 2415016337
commit a6af37e51b
3 changed files with 19 additions and 23 deletions

View File

@@ -795,23 +795,18 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
self.selectedIndex = index;
if (isLogin) {
for (int i = 0; i < self.viewControllers.count; i++) {
UIViewController *itemVc = self.viewControllers[i];
NSString *urlString = [[ClientConfig shareConfig] loadConfigNormalTabImagePath:i];
if (![urlString hasPrefix:@"http"]) {
continue;
[self.viewControllers enumerateObjectsWithOptions:NSEnumerationConcurrent
usingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
NSString *urlString_1 = [[ClientConfig shareConfig] loadConfigNormalTabImagePath:idx];
if ([urlString_1 hasPrefix:@"http"]) {
[self loadCustomTabImage:urlString_1 targetVC:obj isForSelected:NO];
}
[self loadCustomTabImage:urlString targetVC:itemVc isForSelected:NO];
}
for (int i = 0; i < self.viewControllers.count; i++) {
UIViewController *itemVc = self.viewControllers[i];
NSString *urlString = [[ClientConfig shareConfig] loadConfigSelectedTabImagePath:i];
if (![urlString hasPrefix:@"http"]) {
continue;
NSString *urlString_2 = [[ClientConfig shareConfig] loadConfigSelectedTabImagePath:idx];
if ([urlString_2 hasPrefix:@"http"]) {
[self loadCustomTabImage:urlString_2 targetVC:obj isForSelected:YES];
}
[self loadCustomTabImage:urlString targetVC:itemVc isForSelected:YES];
}
}];
}
}
@@ -824,8 +819,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
progress:nil
completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
if (image) {
// tabbar
CGSize iconSize = CGSizeMake(40, 40); //
CGSize iconSize = CGSizeMake(40, 40);
UIGraphicsBeginImageContextWithOptions(iconSize, NO, 0.0);
[image drawInRect:CGRectMake(0, 0, iconSize.width, iconSize.height)];
UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext();