I'm experiencing some odd behavior when integrating AdColony's 2.2.4 library with an application using SVProgressHUD. If the standard configuration call is made in the app delegate...

[AdColony configureWithAppID:kAdColonyAppID zoneIDs:@[kAdColonyZoneID] delegate:nil logging:true];

SVProgressHUD no longer pops up in the app by calling

[SVProgressHUD showWithStatus@"Status..."];

Simply commenting out the AdColony configureWithAppID call causes SVProgressHUD to function again normally. Has anyone else encountered this, or found a way to make them both work in the same application?

有帮助吗?

解决方案

It looks like the SVProgressHUD code is doing a check on line 436 that doesn't take into account that there can be multiple UIWindows in existence belonging to the UIWindowLevelNormal level. The consequence of this is that the HUD view is being added to the wrong window. In order to get the SVProgressHUD working, you can modify the for loop starting on line 436 as follows:

for (UIWindow *window in frontToBackWindows) {
    if (window.keyWindow) {
        [window addSubview:self.hudView];
        break;
    }
}

Please feel free to contact us (support@adcolony.com) with any further integration questions you may have.

其他提示

It works for me ,I have added adcolony framework so success messages for SVProgress hud was not showing: I comment the code:

//        for (UIWindow *window in frontToBackWindows)
//            if (window.windowLevel == UIWindowLevelNormal) {
//                [window addSubview:self.overlayView];
//                break;
//            }

and replace with

for (UIWindow *window in frontToBackWindows) {
            if (window.keyWindow) {
                [window addSubview:self.hudView];
                break;
            }
        }

So It works,.. .Thanks

The simplest way which worked for me is

[[[UIApplication sharedApplication] keyWindow] addSubview:self. overlayView];

This performs the same action the accepted answer.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top