1

So I am trying to have multiple(five actually)iAd banners in one view controller, and have them animate up from the bottom in succession as they each receive an add. I am trying to figure out the best way to implement this. Since they are all in one view controller, I have the delegate for each set to self, so they all call - (void)bannerViewDidLoadAd:(ADBannerView *)banner

and I have worked with iAds before, and with only one banner, I usually offset it from the bottom of the screen and then do this

-(void)bannerView:(ADBannerView *)banner 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;


   }
}

but obviously banner cannot refer to all the banners at the same time,so how would I do this? Could I just use the property for each of them in this same way? I did try that, but it did not seem to be working.

And also, this is for a joke, and my personal desire to figure this out, in case you are wondering why I want five ad banners on one view.

Thanks!

4

1 回答 1

1

在框架的眼中,有多个指向同一个委托的 iAd 实例可能是被禁止的,因此最好创建一个视图控制器,为要显示的每个 iAd 实现 iAd 委托方法,然后添加每个视图控制器subView 到显示所有广告的主视图。

于 2012-12-05T01:57:34.280 回答