Reputation: 523
// 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?
Upvotes: 3
Views: 207
Reputation: 227
Set your alpha to 0 in your storyboard on the iAd. Then it will work with the code you've provided.
Upvotes: 1
Reputation: 1738
In your header file..
@property (strong, nonatomic) IBOutlet ADBannerView *adBanner;
In your implementation file..
- (void) bannerViewDidLoadAd:(ADBannerView *)banner {
adBanner.hidden = 0;
}
- (void) bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
adBanner.hidden = 1;
}
Upvotes: 1