3

这是我的代码:

gAdView=[[GADBannerView alloc] initWithFrame:CGRectMake(0,self.view.bounds.size.height-GAD_SIZE_320x50.height,GAD_SIZE_320x50.width,GAD_SIZE_320x50.height)];
gAdView.adUnitID = admobID;
gAdView.rootViewController=self;
gAdView.delegate = self;
[self.view addSubview:gAdView];
[gAdView loadRequest:[self createRequest]];

它在 iOS 5 和 iOS 6 中运行良好,但在 iOS 7 中却没有显示?为什么?ADMOB 库:6.5.1

4

1 回答 1

0

以下代码适用于我在 iOS 7 上,

bannerView_      = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];   
bannerView_.adUnitID           = @"your-mediation-id";
bannerView_.rootViewController = self;
bannerView_.frame = CGRectMake(0,518,320,50);
[self.view addSubview:bannerView_];
[bannerView_ loadRequest:[GADRequest request]];

为什么要设置委托?

于 2013-10-22T12:22:34.960 回答