Skip to content

Commit

Permalink
Merge pull request #51 from vackup/master
Browse files Browse the repository at this point in the history
check if window IsKeyWindow when trying to add the overlayview
  • Loading branch information
Redth committed Oct 11, 2017
2 parents 94ae3a5 + ae3e10e commit 362c9e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion BTProgressHUD/ProgressHUD.cs
Expand Up @@ -274,7 +274,7 @@ public override void Draw (CGRect rect)
var windows = UIApplication.SharedApplication.Windows;
Array.Reverse (windows);
foreach (UIWindow window in windows) {
if (window.WindowLevel == UIWindowLevel.Normal && !window.Hidden) {
if (window.WindowLevel == UIWindowLevel.Normal && !window.Hidden && window.IsKeyWindow) {
window.AddSubview (OverlayView);
break;
}
Expand Down

0 comments on commit 362c9e6

Please sign in to comment.