Преглед изворни кода

进度条loading样式优化

Steven пре 7 месеци
родитељ
комит
5860e0426d

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Common/Base/LoadingManager/KSHudLoagingManager.m

@@ -136,7 +136,7 @@
     [self removeLoadingView];
     [self removeLoadingView];
     self.HUD = [MBProgressHUD showHUDAddedTo:[NSObject getKeyWindow] animated:YES];
     self.HUD = [MBProgressHUD showHUDAddedTo:[NSObject getKeyWindow] animated:YES];
     self.HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
     self.HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
-    self.HUD.label.text = text;
+    self.HUD.label.attributedText = [self getAttrStringWithText:text];
     self.HUD.contentColor = [UIColor whiteColor];
     self.HUD.contentColor = [UIColor whiteColor];
     self.HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
     self.HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
     self.HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8f);
     self.HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8f);

+ 12 - 2
KulexiuForStudent/KulexiuForStudent/Common/Base/WebView/KSBaseWKWebViewController.m

@@ -1562,7 +1562,7 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
         if (!_HUD) {
         if (!_HUD) {
             _HUD = [MBProgressHUD showHUDAddedTo:keyWindow animated:YES];
             _HUD = [MBProgressHUD showHUDAddedTo:keyWindow animated:YES];
             _HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
             _HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
-            _HUD.label.text = @"正在上传视频...";
+            _HUD.label.attributedText = [self getAttrStringWithText:@"正在上传视频文件..."];
             _HUD.contentColor = [UIColor whiteColor];
             _HUD.contentColor = [UIColor whiteColor];
             _HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
             _HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
             _HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
             _HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
@@ -1577,7 +1577,17 @@ typedef NS_ENUM(NSInteger, CHOOSETYPE) {
         [_HUD hideAnimated:YES];
         [_HUD hideAnimated:YES];
     }
     }
 }
 }
-
+- (NSMutableAttributedString *)getAttrStringWithText:(NSString *)text {
+    if (![NSString isEmptyString:text]) {
+        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+        [paragraphStyle setLineSpacing:6];//调整行间距
+        NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:HexRGB(0xffffff)}];
+        return attr;
+    }
+    else {
+        return [[NSMutableAttributedString alloc] initWithString:@""];
+    }
+}
 - (void)uploadImageArray:(NSMutableArray *)imageArray bucket:(NSString *)bucket {
 - (void)uploadImageArray:(NSMutableArray *)imageArray bucket:(NSString *)bucket {
     [LOADING_MANAGER showHUD];
     [LOADING_MANAGER showHUD];
     NSMutableArray *imageDataArray = [NSMutableArray array];
     NSMutableArray *imageDataArray = [NSMutableArray array];

+ 12 - 2
KulexiuForStudent/KulexiuForStudent/Module/Course/AccompanyCourse/Controller/AccompanyDetailViewController.m

@@ -557,7 +557,7 @@
             _HUD = [MBProgressHUD showHUDAddedTo:keyWindow animated:YES];
             _HUD = [MBProgressHUD showHUDAddedTo:keyWindow animated:YES];
             _HUD.removeFromSuperViewOnHide = YES;
             _HUD.removeFromSuperViewOnHide = YES;
             _HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
             _HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
-            _HUD.label.text = @"正在上传视频文件...";
+            _HUD.label.attributedText = [self getAttrStringWithText:@"正在上传视频文件..."];
             _HUD.contentColor = [UIColor whiteColor];
             _HUD.contentColor = [UIColor whiteColor];
             _HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
             _HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
             _HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
             _HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
@@ -571,7 +571,17 @@
     }
     }
 }
 }
 
 
-
+- (NSMutableAttributedString *)getAttrStringWithText:(NSString *)text {
+    if (![NSString isEmptyString:text]) {
+        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+        [paragraphStyle setLineSpacing:6];//调整行间距
+        NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:HexRGB(0xffffff)}];
+        return attr;
+    }
+    else {
+        return [[NSMutableAttributedString alloc] initWithString:@""];
+    }
+}
 
 
 - (void)tryJoinRoom {
 - (void)tryJoinRoom {
     
     

+ 12 - 2
KulexiuForStudent/KulexiuForStudent/Module/Course/MusicRoom/Controller/MusicRoomDetailViewController.m

@@ -479,7 +479,7 @@
             _HUD = [MBProgressHUD showHUDAddedTo:keyWindow animated:YES];
             _HUD = [MBProgressHUD showHUDAddedTo:keyWindow animated:YES];
             _HUD.removeFromSuperViewOnHide = YES;
             _HUD.removeFromSuperViewOnHide = YES;
             _HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
             _HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
-            _HUD.label.text = @"正在上传视频文件...";
+            _HUD.label.attributedText = [self getAttrStringWithText:@"正在上传视频文件..."];
             _HUD.contentColor = [UIColor whiteColor];
             _HUD.contentColor = [UIColor whiteColor];
             _HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
             _HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
             _HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
             _HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
@@ -493,7 +493,17 @@
     }
     }
 }
 }
 
 
-
+- (NSMutableAttributedString *)getAttrStringWithText:(NSString *)text {
+    if (![NSString isEmptyString:text]) {
+        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+        [paragraphStyle setLineSpacing:6];//调整行间距
+        NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:HexRGB(0xffffff)}];
+        return attr;
+    }
+    else {
+        return [[NSMutableAttributedString alloc] initWithString:@""];
+    }
+}
 
 
 - (void)tryJoinRoom {
 - (void)tryJoinRoom {
     
     

+ 13 - 1
KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/Controller/HomeworkDetailViewController.m

@@ -414,7 +414,7 @@
             _HUD = [MBProgressHUD showHUDAddedTo:keyWindow animated:YES];
             _HUD = [MBProgressHUD showHUDAddedTo:keyWindow animated:YES];
             _HUD.removeFromSuperViewOnHide = YES;
             _HUD.removeFromSuperViewOnHide = YES;
             _HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
             _HUD.mode = MBProgressHUDModeDeterminateHorizontalBar;
-            _HUD.label.text = @"正在上传视频文件...";
+            _HUD.label.attributedText = [self getAttrStringWithText:@"正在上传视频文件..."];
             _HUD.contentColor = [UIColor whiteColor];
             _HUD.contentColor = [UIColor whiteColor];
             _HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
             _HUD.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
             _HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
             _HUD.bezelView.backgroundColor = HexRGBAlpha(0x000000, 0.8);
@@ -427,6 +427,18 @@
         [_HUD hideAnimated:YES];
         [_HUD hideAnimated:YES];
     }
     }
 }
 }
+
+- (NSMutableAttributedString *)getAttrStringWithText:(NSString *)text {
+    if (![NSString isEmptyString:text]) {
+        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+        [paragraphStyle setLineSpacing:6];//调整行间距
+        NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:text attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:HexRGB(0xffffff)}];
+        return attr;
+    }
+    else {
+        return [[NSMutableAttributedString alloc] initWithString:@""];
+    }
+}
 /*
 /*
 #pragma mark - Navigation
 #pragma mark - Navigation