-1

I am running AdMob on my app, but the tutorial provided by google has the banner on top of the app, i want it at the bottom of the app/screen, i use rows 0 to 17, so anything after row 18 is fine.

This is the method that draws the ad if one was received:

-(void) adViewDidReceiveAd:(GADBannerView *)adView
{
    [UIView animateWithDuration:1.0 animations:^{adView.frame = CGRectMake(0.0, 0.0, adView.frame.size.width, adView.frame.size.height);
    }];
}

What would i need to do to have it displayed at the bottom of the screen?

Thank you guys.

Jamie Taylor
  • 4,709
  • 5
  • 44
  • 66
user3396301
  • 101
  • 1
  • 3
  • 8

2 Answers2

2

Set the Y position to the height of the screen minus the height of the view (in landscape orientation you need to use the width of the screen instead):

adView.frame = CGRectMake(0.0, [UIScreen mainScreen].bounds.size.height.y - adView.frame.size.height, adView.frame.size.width, adView.frame.size.height);
mspensieri
  • 3,501
  • 15
  • 18
1

I assume you are in the view controller:

[UIView animateWithDuration:1.0 animations:^{adView.frame = 
    CGRectMake(0.0, 
               self.view.bounds.size.height-adView.frame.size.height, 
               adView.frame.size.width, 
               adView.frame.size.height);
}];
Hermann Klecker
  • 14,039
  • 5
  • 48
  • 71
  • nearly worked, its still showing the ad on top of my row 17, i need it to go down a bit further – user3396301 Apr 02 '14 at 18:45
  • Well, I don't know anything about your row logic. Depending on your layout and view programming language, you may have to use the window's bounds instead of self.view. – Hermann Klecker Apr 02 '14 at 19:00