Created
November 11, 2010 02:41
-
-
Save kwylez/671894 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)fixupAdView:(UIInterfaceOrientation)toInterfaceOrientation { | |
if (adBannerView != nil) { | |
[super configureIAdContentSizes]; | |
[UIView beginAnimations:@"fixupViews" context:nil]; | |
CGFloat toolbarHeight = self.toolbar.frame.size.height; | |
if (adBannerViewIsVisible) { | |
CGRect adBannerViewFrame = [adBannerView frame]; | |
CGRect contentViewFrame = self.tblView.frame; | |
adBannerViewFrame.origin.x = 0; | |
adBannerViewFrame.origin.y = 0 + toolbarHeight; | |
[adBannerView setFrame:adBannerViewFrame]; | |
contentViewFrame.size.height -= [self getBannerHeight:toInterfaceOrientation]; | |
contentViewFrame.origin.y = UIInterfaceOrientationIsLandscape(toInterfaceOrientation) ? | |
[self getBannerHeight:toInterfaceOrientation] + toolbarHeight + 30 : | |
[self getBannerHeight:toInterfaceOrientation] + toolbarHeight + 10; | |
self.tblView.frame = contentViewFrame; | |
} else { | |
CGRect adBannerViewFrame = [adBannerView frame]; | |
adBannerViewFrame.origin.x = 0; | |
adBannerViewFrame.origin.y = -([self getBannerHeight:toInterfaceOrientation] + toolbarHeight); | |
[adBannerView setFrame:adBannerViewFrame]; | |
CGRect contentViewFrame = self.tblView.frame; | |
contentViewFrame.origin.y = 0 + toolbarHeight; | |
contentViewFrame.size.height = self.tblView.frame.size.height; | |
self.tblView.frame = contentViewFrame; | |
} | |
[UIView commitAnimations]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment