I am using AdMob and loading a GADBannerView into a UITableViewController instead of a general UIView. Can anyone tell me how to have the banner load in and just appear at the top of the table view? Below is the code:
In the nameViewController.h file:
@interface nameViewController : UITableViewController {
GADBannerView *AbMob;
}
In the nameViewController.m file on (void)viewDidLoad:
//AdMob block
AbMob = [[GADBannerView alloc]
initWithFrame:CGRectMake(0.0,
self.view.frame.size.height -
GAD_SIZE_320x50.height,
GAD_SIZE_320x50.width,
GAD_SIZE_320x50.height)];
AbMob.adUnitID = AdMob_ID;
AbMob.rootViewController = self;
[self.view addSubview:AbMob];
GADRequest *r = [[GADRequest alloc] init];
r.testing = YES;
[AbMob loadRequest:r];
Any ideas would be greatly appreciated, right now its just kind of floating out there.
Here is a full-blown example of how to embed an ad at both the top and bottom of a table view. Slight modifications could be made to only show one at the top.
Note that per AdMob T&C, there can only be a maximum of 2 ads even in a long table view, and no more than 1 ad should be showing at one time. Just showing 1 ad at the top works just fine as well.