Skip to content

Commit 2d45e97

Browse files
author
Wilson Yuan
committed
Merge pull request #2 from jcgsxr/master
Fix color for clear mask type
2 parents fdb8fae + db13be0 commit 2d45e97

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Demo/WSProgressHUD.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Demo/WSProgressHUD/WSProgressHUD.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ - (void)updateSubviewsPositionWithString: (NSString *)string
567567
WSProgressHUDStringRect.origin.y = imageOffset;
568568
[self startIndicatorAnimation:NO];
569569
self.labelView.center = CGPointMake(hudCenterX , hudCenterY + 20);
570+
self.labelView.textAlignment = NSTextAlignmentCenter;
570571
self.imageView.center = CGPointMake(hudCenterX, 30);
571572
} else {
572573
self.labelView.text = string;
@@ -982,7 +983,7 @@ - (void)drawRect:(CGRect)rect
982983
switch (self.maskType) {
983984
case WSProgressHUDMaskTypeClear: {
984985
CGContextRef context = UIGraphicsGetCurrentContext();
985-
[[UIColor colorWithWhite:0 alpha:0.5] set];
986+
[[UIColor clearColor] set];
986987
CGRect bounds = self.bounds;
987988
CGContextFillRect(context, bounds);
988989
}break;

WSProgressHUD/WSProgressHUD.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ - (void)updateSubviewsPositionWithString: (NSString *)string
566566
WSProgressHUDStringRect.origin.y = imageOffset;
567567
[self startIndicatorAnimation:NO];
568568
self.labelView.center = CGPointMake(hudCenterX , hudCenterY + 20);
569+
self.labelView.textAlignment = NSTextAlignmentCenter;
569570
self.imageView.center = CGPointMake(hudCenterX, 30);
570571
} else {
571572
self.labelView.text = string;
@@ -981,7 +982,7 @@ - (void)drawRect:(CGRect)rect
981982
switch (self.maskType) {
982983
case WSProgressHUDMaskTypeClear: {
983984
CGContextRef context = UIGraphicsGetCurrentContext();
984-
[[UIColor colorWithWhite:0 alpha:0.5] set];
985+
[[UIColor clearColor] set];
985986
CGRect bounds = self.bounds;
986987
CGContextFillRect(context, bounds);
987988
}break;

0 commit comments

Comments
 (0)