From a6af37e51bd0895be5a6897e94ed007d8d62a245 Mon Sep 17 00:00:00 2001 From: edwinQQQ <> Date: Thu, 28 Nov 2024 11:05:57 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=AD=A3=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E8=AF=AD=E8=A8=80=E5=90=8E=20tabbar=20=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=A1=BA=E5=BA=8F=E4=B8=8D=E6=AD=A3=E7=A1=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/Setting/XPMineSwitchLanguageVC.m | 12 ++++---- .../YMRoom/View/XPRoomViewController.m | 2 +- .../YMTabbar/View/TabbarViewController.m | 28 ++++++++----------- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/YuMi/Modules/YMMine/View/Setting/XPMineSwitchLanguageVC.m b/YuMi/Modules/YMMine/View/Setting/XPMineSwitchLanguageVC.m index f189fef2..cb1ae158 100644 --- a/YuMi/Modules/YMMine/View/Setting/XPMineSwitchLanguageVC.m +++ b/YuMi/Modules/YMMine/View/Setting/XPMineSwitchLanguageVC.m @@ -57,11 +57,13 @@ } [NSBundle setLanguageText:language]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"kSwitchLanguage" object:language]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"kNavViewUpdateWhenLanguageUpdate" object:language]; - - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5* NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [self.navigationController popViewControllerAnimated:YES]; + [self.navigationController popToRootViewControllerAnimated:YES]; + + [self showLoading]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self hideHUD]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"kNavViewUpdateWhenLanguageUpdate" object:language]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"kSwitchLanguage" object:language]; }); } #pragma mark - UITableViewDelegate And UITableViewDataSource diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index af3ee66c..7382a4d7 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -2120,7 +2120,7 @@ XPCandyTreeInsufficientBalanceViewDelegate> } } //发送消息成功回调 -- (void)sendMessage:(NIMMessage *)message didCompleteWithError:(NSError *)error { +- (void)sendMessage:(NIMMessage *)message didCompleteWithError:(NSError *)error { if (message.yidunAntiSpamRes) { NSDictionary * spamRes = message.yidunAntiSpamRes.toJSONObject; id spamResExt = ((NSString *)spamRes[@"ext"]).toJSONObject; diff --git a/YuMi/Modules/YMTabbar/View/TabbarViewController.m b/YuMi/Modules/YMTabbar/View/TabbarViewController.m index a04d8c0b..34f47003 100644 --- a/YuMi/Modules/YMTabbar/View/TabbarViewController.m +++ b/YuMi/Modules/YMTabbar/View/TabbarViewController.m @@ -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();