// iAd Advertising
#pragma mark iAd Delegate Methods
- (void) bannerViewDidLoadAd:(ADBannerView *)banner {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[banner setAlpha:1];
[UIView commitAnimations];
} // if there is an internet connection, load the iAd with a 1 second fade in effect
- (void) bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[banner setAlpha:0];
[UIView commitAnimations];
}
When setAlpha is 0, shouldn't it disappear as opposed to displaying a white line across the screen as a replacement for the ad that isn't there?
I want the banner to completely disappear, but it shows a white banner instead. I've used this type of animating before and had no problem with it making things completely disappear. Is it because it is an iAd banner?
Set your alpha to 0 in your storyboard on the iAd. Then it will work with the code you've provided.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With