fix:修正切换语言后 tabbar 显示顺序不正确问题
This commit is contained in:
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user