Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't this iAd properly disappear?

// 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?

like image 213
Liam Stockhomme Avatar asked Dec 02 '25 07:12

Liam Stockhomme


1 Answers

Set your alpha to 0 in your storyboard on the iAd. Then it will work with the code you've provided.

like image 133
Shen Hutah Avatar answered Dec 03 '25 21:12

Shen Hutah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!