IAD横幅不显示

  • 本文关键字:显示 IAD iad
  • 更新时间 :
  • 英文 :


我有一个未显示的IAD横幅。这是我的代码:

.h文件:

#import <UIKit/UIKit.h>
#import <iAd/iAd.h>
@interface PopViewController : UIViewController <ADBannerViewDelegate>
{
}
@end

.m文件

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)bannerViewDidLoadAd:(ADBannerView *)banner {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[banner setAlpha:1.0];
[UIView commitAnimations];
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error     {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[banner setAlpha:0];
[UIView commitAnimations];
}

横幅根本不显示。有人可以修复此代码吗?我已经将横幅链接到文件所有者并成为代表。谢谢

我也看过该代码,这也对我不起作用。试试看。Lemme知道这是怎么回事。如果它不起作用,我可以为您提供更多帮助。

- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
    if (banner.isBannerLoaded)
    {
        [UIView beginAnimations:@"animateAdBannerOff" context:NULL];
        // Assumes the banner view is placed at the bottom of the screen.
        banner.frame = CGRectOffset(banner.frame, 0, banner.frame.size.height);
        [UIView commitAnimations];
    }

}
- (void)bannerViewDidLoadAd:(ADBannerView *)banner
{
    if (!banner.isBannerLoaded)
    {
        [UIView beginAnimations:@"animateAdBannerOn" context:NULL];
        // Assumes the banner view is just off the bottom of the screen.
        //banner.frame = CGPointMake(self.size.width/2, self.size.height);
        banner.frame = CGRectOffset(banner.frame, 0, -banner.frame.size.height);
        [UIView commitAnimations];
    }
}

最新更新