Skip to content

Commit

Permalink
Merge pull request #110 from redth-org/bugfix/gh-109-clear-background
Browse files Browse the repository at this point in the history
Fix issue when using Clear HudBackgroundColor
  • Loading branch information
Cheesebaron authored Jun 26, 2024
2 parents 0834e7b + 89b2604 commit 4f9d79c
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions BTProgressHUD/ProgressHUD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,28 @@ UIView HudView
if (_hudView != null)
return _hudView;

var hudView = new UIToolbar
UIView hudView;
if (ProgressHUDAppearance.HudBackgroundColor.Equals(UIColor.Clear))
{
Translucent = true,
BarTintColor = ProgressHUDAppearance.HudBackgroundColor,
BackgroundColor = ProgressHUDAppearance.HudBackgroundColor,
AutoresizingMask =
UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleTopMargin |
UIViewAutoresizing.FlexibleRightMargin | UIViewAutoresizing.FlexibleLeftMargin
};
hudView = new UIView
{
BackgroundColor = ProgressHUDAppearance.HudBackgroundColor
};
}
else
{
hudView = new UIToolbar
{
Translucent = true,
BarTintColor = ProgressHUDAppearance.HudBackgroundColor,
BackgroundColor = ProgressHUDAppearance.HudBackgroundColor
};
}

hudView.AutoresizingMask =
UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleTopMargin |
UIViewAutoresizing.FlexibleRightMargin | UIViewAutoresizing.FlexibleLeftMargin;

hudView.Layer.CornerRadius = ProgressHUDAppearance.HudCornerRadius;
hudView.Layer.MasksToBounds = true;

Expand Down

0 comments on commit 4f9d79c

Please sign in to comment.