What I'm doing is animating in the new ad, but it does it even if I don't use animation. First off here is my code.
Code:
CGSize adSize = [adView actualAdSize];
CGRect newFrame = adView.frame;
newFrame.size = adSize;
newFrame.origin.y = 20;
newFrame.origin.x = (self.view.bounds.size.width - adSize.width)/ 2;
adView.frame = newFrame;
CGRect tabFrame = uiTabBarController.view.frame;
tabFrame.size = CGSizeMake(320, 480-20-adSize.height);
tabFrame.origin.y = 20+adSize.height;
uiTabBarController.view.frame = tabFrame;
I used NSLog at the beginning of that block to see what the tabbar controllers frame is, then at the end printed the size/frame of the adbar, and the tabbar after being changed. Here is the output.
Code:
Tab Bar Controller Frame: {{0, 0}, {320, 480}}
Ad Size: {320, 50}
Tab Bar Controller Frame: {{0, 70}, {320, 410}}
Ad Frame: {{0, 20}, {320, 50}}
Tab Bar Controller Frame: {{0, 70}, {320, 410}}
Ad Size: {320, 48}
Tab Bar Controller Frame: {{0, 68}, {320, 412}}
Ad Frame: {{0, 20}, {320, 48}}
Looks correct doesn't it? Well what I get is 20px status bar up top, 50px for the ad (if its a 50px ad), then a weird black bar beneath the ad covering up the first row in my tableview. Then underneath is everything as it should be. However if I switch to a different tab and back the bar is gone and everything works as it should.
Here is what it looks like.
Click Here
Thanks for your help.