ShowtipTool.m 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // ShowtipTool.m
  3. // IntercontinentalHealth
  4. //
  5. // Created by zsj on 2018/5/30.
  6. // Copyright © 2018年 ITpower. All rights reserved.
  7. //
  8. #import "ShowtipTool.h"
  9. #import "SVProgressHUD.h"
  10. @implementation ShowtipTool
  11. +(void)showLoadingWithStatus:(NSString *)status{
  12. [self hide];
  13. // [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeBlack];
  14. status=(status.length==0)?nil:status;
  15. SVProgressHUD.minimumDismissTimeInterval=MAXFLOAT;
  16. [SVProgressHUD setFont:Kfont(13)];
  17. // [SVProgressHUD showImage:[UIImage imageNamed:@"loading"] status:status];
  18. // [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];
  19. [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear];
  20. [SVProgressHUD setForegroundColor:[UIColor whiteColor]];// 弹出框内容颜色
  21. [SVProgressHUD setBackgroundColor:kColorFromRGBAlpha(0X000000, 0.5)];
  22. [SVProgressHUD showWithStatus:status];
  23. }
  24. +(void)showInfoWithStatus:(NSString *)status{
  25. if (status.length==0) {
  26. status=@"";
  27. }
  28. [self hide];
  29. [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
  30. [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
  31. [SVProgressHUD setBackgroundColor:kColorFromRGBAlpha(0X000000, 0.5)]; SVProgressHUD.minimumDismissTimeInterval=1.20;
  32. [SVProgressHUD showInfoWithStatus:status];
  33. }
  34. +(void)showSuccessWithStatus:(NSString *)status{
  35. [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
  36. [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
  37. [SVProgressHUD setBackgroundColor:kColorFromRGBAlpha(0X000000, 0.5)];
  38. SVProgressHUD.minimumDismissTimeInterval=1.20;
  39. [SVProgressHUD showSuccessWithStatus:status];
  40. }
  41. +(void)showErrorWithStatus:(NSString *)status{
  42. [self hide];
  43. [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
  44. [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeBlack];
  45. [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
  46. [SVProgressHUD setBackgroundColor:kColorFromRGBAlpha(0X000000, 0.5)];
  47. SVProgressHUD.minimumDismissTimeInterval=1.20;
  48. [SVProgressHUD showErrorWithStatus:status];
  49. }
  50. +(void)showMessageWithStatus:(NSString *)status{
  51. [self hide];
  52. [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
  53. [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
  54. [SVProgressHUD setBackgroundColor:kColorFromRGBAlpha(0X000000, 0.5)];
  55. [SVProgressHUD setInfoImage:nil];
  56. SVProgressHUD.minimumDismissTimeInterval=1.20;
  57. [SVProgressHUD showInfoWithStatus:status];
  58. }
  59. +(void)showMessageLongWithStatus:(NSString *)status{
  60. [self hide];
  61. [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
  62. [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
  63. [SVProgressHUD setBackgroundColor:kColorFromRGBAlpha(0X000000, 0.5)];
  64. [SVProgressHUD setInfoImage:nil];
  65. SVProgressHUD.minimumDismissTimeInterval=MAXFLOAT;
  66. [SVProgressHUD showInfoWithStatus:status];
  67. }
  68. +(void)showProgress:(CGFloat)progress Status:(NSString *)status{
  69. [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
  70. [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
  71. [SVProgressHUD setBackgroundColor:kColorFromRGBAlpha(0X000000, 0.5)];
  72. // [SVProgressHUD setInfoImage:nil];
  73. // SVProgressHUD.minimumDismissTimeInterval=MAXFLOAT;
  74. // [SVProgressHUD showProgress:progress status:status];
  75. if (status==nil) {
  76. [SVProgressHUD showProgress:progress];
  77. }else{
  78. [SVProgressHUD showProgress:progress status:status];
  79. }
  80. }
  81. +(void)hide{
  82. [SVProgressHUD dismiss];
  83. }
  84. @end