0

AdMob 広告を表示するために、アプリ (viewDidLoadメソッド)で次のコードを使用しています。

// 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も何も起こりません。

誰でも問題が何であるかを提案できますか?

4

1 に答える 1

0

「自分の中で使う」とはどういう意味UIWebViewですか?

GADBannerViewをサブビューとして に追加していますUIWebViewか? それはうまくいかないからです。の高さを減らして、を含む何らかのタイプのコンテナ ビューに をUIWebView追加する方がよいでしょう。GADBannerViewUIWebView

基本的に、ビュー階層でUIWebViewと をGADBannerView兄弟にします。

于 2012-12-28T18:20:26.967 に答える