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

@@ -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

View File

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

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();