I'm trying to resize my tableView when I am have an AdMob view at the bottom of my screen. I've tried a couple things: Change UITableView height dynamically and Resizing UITableView When Displaying AdWhirl Ads Across Multiple Views and Change size of UIViewTable to accommodate for AdWhirl Ad but none of those have worked. By not worked, I mean NOTHING happens. The view is EXACTLY the same as it was before I tried those changes. So you know, this tableView
is nested inside of a ViewController
. Here is the layout:
Here is the last thing I've tried:
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController setNavigationBarHidden:NO];
#ifdef FREERECORDER
CGPoint origin = CGPointMake(0.0,self.view.frame.size.height - 90 - CGSizeFromGADAdSize(kGADAdSizeBanner).height);
gBannerView =[[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner
origin:origin];
//this is where I'm attempting to resize
CGRect tableFrame = self->tableView.frame;
tableFrame.size.height = self->tableView.frame.size.height - 500;
self->tableView.frame = tableFrame;
gBannerView.adUnitID = @"MY_AD_ID";
gBannerView.rootViewController = self;
[self.view addSubview:gBannerView];
GADRequest *request = [GADRequest request];
// Make the request for a test ad. Put in an identifier for
// the simulator as well as any devices you want to receive test ads.
request.testDevices = [NSArray arrayWithObjects:
@" MY_TEST_ID",
nil];
[gBannerView loadRequest:[GADRequest request]];
#endif
self.title = @"All Root Beers";
RootBeerFeedParser* rfp = [[RootBeerFeedParser alloc]init];
rootBeerList = [rfp getCoreDataRootBeers];
self.tabBar.delegate = self;
[self->tableView reloadData];
}
This is the result:
![enter image description here][2]
What it doesn't show, is that the last cell in the tableview
is covered by that advertisement and I'm trying to fix that.