Is it a problem when an iAd may be obscured?

后端 未结 8 2368
执笔经年
执笔经年 2021-02-13 05:17

I added the ADBannerView to a view and when I load the app I get the following message:

ADBannerView: WARNING A banner view (0x7a023c0) has an ad but may be obscured. Th

8条回答
  •  -上瘾入骨i
    2021-02-13 06:04

    To add to this discussion, I received this message when I modified the center property to move the ad just outside the screen. I use UIView animations to slide the ad onto the screen.

    After some experimenting I figured out how to do this without causing the message to appear. The trick was to hide to set the adBannerView.hidden property to YES while waiting for the ad to load. Once it was loaded, I just had to make sure to set the hidden property to NO only after committing the animation:

    -(void) fadeAdIn:(UIView*)view
    {
        float offsetY = view.frame.size.height * (bannerOnBottom ? 1 : -1);
    
        CGPoint pos = [self getBannerPosition];
        view.center = CGPointMake(pos.x, pos.y + offsetY);
    
        [UIView beginAnimations:@"AdIn" context:nil];
        [UIView setAnimationDuration:1.0];
        view.center = pos;
        [UIView commitAnimations];
    
        // must unhide AFTER animation has been committed to prevent "ad obstructed"
        view.hidden = NO;
    }
    

提交回复
热议问题