我在我的应用程序(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
没有任何反应。
谁能建议问题可能是什么?