私は、IOS4.3でユニバーサルアプリ(iPhone/iPad)のテストを行っています。それは両方の向きで画面の下部に配置するiAdを持っています。 以下はコードです。画面の下にiAdを配置(両方の向き)
- (void) viewWillAppear:(BOOL)animated {
adView_.requiredContentSizeIdentifiers = [NSSet setWithObjects: ADBannerContentSizeIdentifierPortrait, ADBannerContentSizeIdentifierLandscape, nil];
adView_.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
CGRect adFrame = adView_.frame;
adFrame.origin.y = self.view.frame.size.height-adView_.frame.size.height;
adView_.frame = adFrame;
adView_.delegate = self;
[webView addSubview:adView_];
[self.view bringSubviewToFront:adView_];
self.bannerIsVisible=NO;
[super viewWillAppear: animated];
}
オリエンテーションの取り扱いについては、
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation))
self.adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
else
self.adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
CGRect adFrame = adView_.frame;
adFrame.origin.y = self.view.frame.size.height-adView_.frame.size.height;
adView_.frame = adFrame;
[webView addSubview:adView_];
[self.view bringSubviewToFront:adView_];
self.bannerIsVisible=NO;
}
私の問題はアプリの読み込み(ポートレート)にあり、iAdが画面の下に表示されていることがわかりました。
しかし、私が風景を風景に変更するとすぐに、私はiAdを見ることができません。私はメッセージを見る。
ADBannerView:警告バナービュー(0x62534a0)には広告がありますが、 が不明瞭です。このメッセージは、バナー表示ごとに1回だけ印刷されます。
私は私が問題を解決する助けてくださいwillRotateToInterfaceOrientation
内部の何か間違ったことをやっていると思います。 ありがとうございます。
Thx多く...問題は修正されません.Plsは代わりの方法を示唆しています。 – testndtv
結果は、willRotateToInterfaceOrientationまたはdidRotateFromInterfaceOrientationを使用して同じです...それらの内部の実際のコードは多少変更する必要がありますか? – testndtv