0

Im struggling to make an iAdBanner appear at the top of the screen instead of the bottom. In the Storyboard I've placed the AdBanner at the top but when the App loads it still appears on the bottom of the screen, however, when I click the Ad and then exit it, the iAdBanner moves to the top of the screen as intended. Any help with getting its default location to the top of the screen is appreciated.

Here is the code that I'm currently using to trigger the add.

- (void)bannerViewDidLoadAd:(ADBannerView *)banner
{
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1];
    [banner setAlpha:1];
    [UIView commitAnimations];
    NSLog(@"Ad Displayed");
}

- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1];
    [banner setAlpha:0];
    [UIView commitAnimations];
    NSLog(@"Ad Failed To Display");
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    // Configure the view.
    SKView * skView = (SKView *)self.view;
    skView.showsFPS = YES;
    skView.showsNodeCount = YES;

    // Create and configure the scene.
    SKScene * scene = [AlienGravityGame sceneWithSize:skView.bounds.size];
    scene.scaleMode = SKSceneScaleModeAspectFill;

    // Present the scene.
    [skView presentScene:scene];
    self.canDisplayBannerAds = YES;
}
nick
  • 101
  • 10
  • http://stackoverflow.com/questions/11927195/objective-c-adbannerview-change-size-and-position – Chen-Hai Teng Feb 12 '14 at 02:51
  • adView.frame = CGRectOffset(adView.frame, 100, 0); doesn't affect the position for me at all – nick Feb 12 '14 at 03:03
  • I just create a SK project, add an iAD banner on the top of screen, then copy your bannerViewDidLoadAd: and bannerView:didFailToReceiveAdWithError: to my view controller. It's works fine on simulator (iphone/iphone retina). – Chen-Hai Teng Feb 12 '14 at 07:35
  • I got it fixed, stupid mistake. thanks for the help – nick Feb 13 '14 at 02:39

0 Answers0