1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- //
- // ShowtipTool.m
- // IntercontinentalHealth
- //
- // Created by zsj on 2018/5/30.
- // Copyright © 2018年 ITpower. All rights reserved.
- //
- #import "ShowtipTool.h"
- #import "SVProgressHUD.h"
- @implementation ShowtipTool
- +(void)showLoadingWithStatus:(NSString *)status{
- [self hide];
- // [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeBlack];
- status=(status.length==0)?nil:status;
- SVProgressHUD.minimumDismissTimeInterval=MAXFLOAT;
- [SVProgressHUD setFont:Kfont(13)];
- // [SVProgressHUD showImage:[UIImage imageNamed:@"loading"] status:status];
- // [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];
- [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear];
- [SVProgressHUD setForegroundColor:[UIColor whiteColor]];// 弹出框内容颜色
- [SVProgressHUD setBackgroundColor:kColorFromRGBAlpha(0X000000, 0.5)];
- [SVProgressHUD showWithStatus:status];
- }
- +(void)showInfoWithStatus:(NSString *)status{
- if (status.length==0) {
- status=@"";
- }
- [self hide];
- [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
- [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
- [SVProgressHUD setBackgroundColor:kColorFromRGBAlpha(0X000000, 0.5)]; SVProgressHUD.minimumDismissTimeInterval=1.20;
- [SVProgressHUD showInfoWithStatus:status];
- }
- +(void)showSuccessWithStatus:(NSString *)status{
- [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
- [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
- [SVProgressHUD setBackgroundColor:kColorFromRGBAlpha(0X000000, 0.5)];
- SVProgressHUD.minimumDismissTimeInterval=1.20;
- [SVProgressHUD showSuccessWithStatus:status];
- }
- +(void)showErrorWithStatus:(NSString *)status{
- [self hide];
- [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
- [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeBlack];
- [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
- [SVProgressHUD setBackgroundColor:kColorFromRGBAlpha(0X000000, 0.5)];
- SVProgressHUD.minimumDismissTimeInterval=1.20;
- [SVProgressHUD showErrorWithStatus:status];
- }
- +(void)showMessageWithStatus:(NSString *)status{
- [self hide];
- [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
- [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
- [SVProgressHUD setBackgroundColor:kColorFromRGBAlpha(0X000000, 0.5)];
- [SVProgressHUD setInfoImage:nil];
- SVProgressHUD.minimumDismissTimeInterval=1.20;
- [SVProgressHUD showInfoWithStatus:status];
- }
- +(void)showMessageLongWithStatus:(NSString *)status{
- [self hide];
- [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
- [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
- [SVProgressHUD setBackgroundColor:kColorFromRGBAlpha(0X000000, 0.5)];
- [SVProgressHUD setInfoImage:nil];
- SVProgressHUD.minimumDismissTimeInterval=MAXFLOAT;
- [SVProgressHUD showInfoWithStatus:status];
- }
- +(void)showProgress:(CGFloat)progress Status:(NSString *)status{
- [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
- [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
- [SVProgressHUD setBackgroundColor:kColorFromRGBAlpha(0X000000, 0.5)];
- // [SVProgressHUD setInfoImage:nil];
- // SVProgressHUD.minimumDismissTimeInterval=MAXFLOAT;
- // [SVProgressHUD showProgress:progress status:status];
- if (status==nil) {
- [SVProgressHUD showProgress:progress];
- }else{
- [SVProgressHUD showProgress:progress status:status];
- }
- }
- +(void)hide{
- [SVProgressHUD dismiss];
- }
- @end
|