【发布时间】:2012-12-28 11:49:20
【问题描述】:
我在我的应用中使用以下代码(viewDidLoad 方法)来展示 AdMob 广告:
// Create a view of the standard size at the bottom of the screen.
// Available AdSize constants are explained in GADAdSize.h.
bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];
// Specify the ad's "unit identifier." This is your AdMob Publisher ID.
bannerView_.adUnitID = @"ABC";
// Let the runtime know which UIViewController to restore after taking
// the user wherever the ad goes and add it to the view hierarchy.
bannerView_.rootViewController = self;
[self.view addSubview:bannerView_];
// Initiate a generic request to load it with an ad.
[bannerView_ loadRequest:[GADRequest request]];
如果我在另一个应用程序或此应用程序的表格视图(根视图控制器)中使用该代码,则广告显示正常。在我的UIWebView 中使用它并没有任何反应。
谁能建议可能是什么问题?
【问题讨论】:
标签: objective-c cocoa-touch uiwebview ios6 admob