问题
So, I have an app that requires internet, and one the beginning, if the user doesn't have internet capabilities, the app shows a blank screen with an error alert. So, iAds should always appear, because the user using the app should alway have internet capabilities, or the view wouldn't load. But sometimes, when I'me testing the app, one out of every 4-5 times the iAd will just come as a white box. Sometimes, in the middle of the app, when I move the iAd to a different position, it also becomes a white box. I actually don't have too much of a problem with this, but I wanted to know if this weird behavior could get my app rejected.
Note: I HAVE included the method:
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{
if (self.bannerIsVisible) {
[UIView beginAnimations:@"animateAdBannerOff" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0, -50);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
}
回答1:
Your method moves iAd banner for 50 px upwards if it's not loaded successfully. So if your banner is originally placed on the bottom of the screen it will only be moved upwards (at unsuccessfull load) - thus it will still be visible (as a white box).
You'd be better of providing a fixed positions for loaded/unloaded banners.
Refer to accepted answer on xcode 4.3 - storyboard - iAd keeps moving
来源:https://stackoverflow.com/questions/10312196/iads-sometime-appearing-as-white-boxes-in-app