Feel free to reference a sample Xcode project hosted on GitHub which demonstrates this issue: IAdBannerBugDemo
When there is an AdBannerView being displayed underneath a UITableView and above a UITabBar, after bannerViewActionDidFinish:
is invoked, the AdBannerView is erroneously moved to the top of its superview.
My questions are:
- Is there a valid workaround for this that isn't a hand jam? If so, what is the workaround?
- Is this a bug with the iOS SDK?
First off, here are two screenshots which illustrate my problem.
- Press the button shown in the 1st screenshot.
- Wait for iAd to load.
- Click the iAd.
- Dismiss the iAd by pressing the black X in the upper-left corner of the full-screen iAd.
- Notice that the iAd moves to the top (2nd screenshot)
Press the button shown and wait for an iAd to load
Press/Click the iAd banner to view the ad fullscreen
Dismiss the fullscreen iAd and notice iOS SDK moved the iAD banner to the top of its superview
By hitting breakpoints and such, I noticed that [UIViewControllerWrapper setFrame:]
is responsible for relocating the AdBannerView, but that is completely out of my control, as it is part of Apple's frameworks.
The only way for me to work around this issue is to correct the location of the AdBannerView by overriding viewWillLayoutSubviews
in whichever view controller is responsible for properly placing the AdBannerView.
But even this workaround produces a jumpy relocation of the AdBannerView from the top of its superview to the correct location (underneath the tableview, above the tab bar, contained in the table view's superview).
A good answer will be one that posts sample code illustrating how to defeat this nagging issue.
I have started a thread on Apple's Developer Forums, as well. So feel free to consult this thread.