// 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];
}
当 setAlpha
为 0
时,它不应该消失,而不是在屏幕上显示一条白线来替代不存在的广告吗?
我希望横幅完全消失,但它显示的是白色横幅。我以前使用过这种类型的动画并且没有问题让事情完全消失。是因为它是 iAd 横幅吗?
最佳答案
在 iAd 的 Storyboard中将 alpha 设置为 0。然后它将使用您提供的代码。
关于ios - 为什么这个 iAd 没有正常消失?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22184479/