iAd left white blank screen after closed

后端 未结 3 1999
时光说笑
时光说笑 2021-01-06 18:20

I got a problem to integrate iAd in my iPhone apps -- the banner ad is fine when it expends (see http://www.clingmarks.com/iAd1.png and http://www.clingmarks.com/iAd2.png),

相关标签:
3条回答
  • 2021-01-06 18:32

    When the banner finishes, it moves itself to the top of the screen even if that means having a negative y coordinate. I center the banner when it finishes. In my case there is a view controller for just the banner, so it is only full screen when the ad is clicked.

    -(void) bannerViewActionDidFinish:(UIView *)inBanner {
        CGRect                      frame = [inBanner frame];
    
        frame.origin.x = frame.size.width * 0.5;
        frame.origin.y = frame.size.height * 0.5;
    
        [inBanner setCenter:frame.origin];
    }
    
    0 讨论(0)
  • 2021-01-06 18:49

    Hey David! I know what you mean, I'm also using an own AdvertisementViewController which calls different ad networks.

    So iAd is not in a full screen view but inside a 320x50 view.

    Simply do this:

    -(void) bannerViewActionDidFinish:(ADBannerView *)inBanner {
    
    [self.view setFrame:CGRectMake(0.0f, 0.0f, 320.0f, 50.0f)];
    
    }
    

    So the outer view container (self.view) is resized to its original size. iAd is resizing it to fullscreen for displaying the ad when an iAd is shown.

    0 讨论(0)
  • 2021-01-06 18:51

    Eventually I figured it out myself. It turns out the ADBannerView's parent view must be a fullscreen view. I my case above, I added AdBannerView to my adView, which is a view with size 320x50. When I changed its parent view to a fullscreen view, everything works. I am not sure if this is a bug in iAd, but certainly something tricky.

    0 讨论(0)
提交回复
热议问题