私のiPhoneアプリにiAdを追加しました。もともと私はそれをx = 0とy = -50に置き、画面外から来るようにしました。xcode 4.3 - storyboard - iAdは動いています
- (void)bannerView:(ADBannerView *)abanner didFailToReceiveAdWithError:(NSError *)error
{
if (self.bannerIsVisible)
{
[UIView beginAnimations:@"animateAdBannerOff" context:NULL];
// Assumes the banner view is placed at the bottom of the screen.
banner.frame = CGRectOffset(banner.frame, 0, banner.frame.size.height);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
}
- (void)bannerViewDidLoadAd:(ADBannerView *)abanner
{
if (!self.bannerIsVisible)
{
[UIView beginAnimations:@"animateAdBannerOn" context:NULL];
// Assumes the banner view is just off the bottom of the screen.
banner.frame = CGRectOffset(banner.frame, 0, banner.frame.size.height);
[UIView commitAnimations];
self.bannerIsVisible = YES;
}
}
私のアプリの起動時にiAdが問題なく表示されると、次のコードが表示されます。しかし、私は別のアプリを開いてそれに戻ってくる(私のアプリがバックグラウンドで実行されるようにそれを殺さずに)バナーは別の50ピクセル下に移動する
何か考えている?
全く広告がない場合、それは白抜きのバーを残しハードコーディング。だから私は最初に画面から外してから、表示する広告があるときにそれを動かします。 – Adeeb
私はそれがオフであり、それが定位置にあることを意味します - それを固定場所に置かないでください。あなたは提案されたコードを試しましたか? –
優秀!!ありがとう – Adeeb