Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS: Universal App Template supporting iAds & screen rotations
    primarykey
    data
    text
    <p>I am trying to construct a iOS universal application template that transparently handles iAds &amp; screen rotations.</p> <p>i.e. instead of using UIViewController for each new project, I will instead use my own iAdVC (which will subclass UIViewController). This will seamlessly handle the iAds, and hand over the remaining window space to the user.</p> <p>I'm trying this: view controller contains uberView which contains {adView, content view}. </p> <p>whenever an ad appears and disappears, both {adView, content view} will animate: </p> <ul> <li>content view squashing the frame's top down slightly to make space for my iAd, </li> <li><p>and fade in the ad along the top at the same time.</p> <p>also, every time the device rotates, the views need to be resized.</p></li> </ul> <p>I'm getting really dumb problem, when the first Ad gets served, I place it at the top of the screen and squash the remaining content frame to make space for it.</p> <p>but if I change the content view's frame, I can no longer click the ad. and if I don't, the content view doesn't fit in its window,</p> <p><a href="http://d.pr/ZyQG" rel="nofollow">http://d.pr/ZyQG</a></p> <pre><code>- (void) bannerViewDidLoadAd: (ADBannerView *) banner { bool isLandscape = UIInterfaceOrientationIsLandscape( self.interfaceOrientation ); NSString * contentSize = isLandscape ? ADBannerContentSizeIdentifierLandscape : ADBannerContentSizeIdentifierPortrait ; [self.adBannerView setCurrentContentSizeIdentifier: contentSize]; CGSize bannerSize = [ADBannerView sizeFromBannerContentSizeIdentifier: contentSize]; self.adBannerView.frame = CGRectMake(0, 0, bannerSize.width, bannerSize.height); // resize content frame &amp; fade ad in CGRect newContentFrame = uberView.bounds; newContentFrame.size.height -= bannerSize.height; newContentFrame.origin.y += bannerSize.height; NSLog(@"%@", NSStringFromCGRect(newContentFrame)); // {{0, 50}, {320, 430}} if (1) // 0 works self.contentView.frame = newContentFrame; // NOW CANT CLICK AD } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload