diff --git a/Demo/WSProgressHUD/WSProgressHUD.m b/Demo/WSProgressHUD/WSProgressHUD.m index 1b12678..43915d9 100644 --- a/Demo/WSProgressHUD/WSProgressHUD.m +++ b/Demo/WSProgressHUD/WSProgressHUD.m @@ -1043,13 +1043,8 @@ - (instancetype)initWithFrame:(CGRect)frame UIImage *successImage = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"success@2x" ofType:@"png"]]; UIImage *failurImage = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"error@2x" ofType:@"png"]]; - if ([[UIImage class] instancesRespondToSelector:@selector(imageWithRenderingMode:)]) { - WSProgressHUDSuccessImage = [successImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - WSProgressHUDErrorImage = [failurImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - } else { - WSProgressHUDErrorImage = failurImage; - WSProgressHUDSuccessImage = successImage; - } + WSProgressHUDSuccessImage = [self image:successImage withTintColor:WSProgressHUDForeGroundColor]; + WSProgressHUDErrorImage = [self image:failurImage withTintColor:WSProgressHUDForeGroundColor]; [self addSubview:self.hudView]; @@ -1104,7 +1099,7 @@ - (UILabel *)labelView } _labelView.adjustsFontSizeToFitWidth = YES; _labelView.autoresizingMask = UIViewAutoresizingFlexibleWidth; - _labelView.textAlignment = NSTextAlignmentLeft; + _labelView.textAlignment = NSTextAlignmentCenter; _labelView.numberOfLines = 0; } return _labelView; diff --git a/WSProgressHUD/WSProgressHUD.m b/WSProgressHUD/WSProgressHUD.m index 1b12678..43915d9 100644 --- a/WSProgressHUD/WSProgressHUD.m +++ b/WSProgressHUD/WSProgressHUD.m @@ -1043,13 +1043,8 @@ - (instancetype)initWithFrame:(CGRect)frame UIImage *successImage = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"success@2x" ofType:@"png"]]; UIImage *failurImage = [UIImage imageWithContentsOfFile:[imageBundle pathForResource:@"error@2x" ofType:@"png"]]; - if ([[UIImage class] instancesRespondToSelector:@selector(imageWithRenderingMode:)]) { - WSProgressHUDSuccessImage = [successImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - WSProgressHUDErrorImage = [failurImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - } else { - WSProgressHUDErrorImage = failurImage; - WSProgressHUDSuccessImage = successImage; - } + WSProgressHUDSuccessImage = [self image:successImage withTintColor:WSProgressHUDForeGroundColor]; + WSProgressHUDErrorImage = [self image:failurImage withTintColor:WSProgressHUDForeGroundColor]; [self addSubview:self.hudView]; @@ -1104,7 +1099,7 @@ - (UILabel *)labelView } _labelView.adjustsFontSizeToFitWidth = YES; _labelView.autoresizingMask = UIViewAutoresizingFlexibleWidth; - _labelView.textAlignment = NSTextAlignmentLeft; + _labelView.textAlignment = NSTextAlignmentCenter; _labelView.numberOfLines = 0; } return _labelView;