ios - 为什么这个 iAd 没有正常消失?

标签 ios objective-c cocoa-touch iad

// 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];
}

setAlpha0 时,它不应该消失,而不是在屏幕上显示一条白线来替代不存在的广告吗?

我希望横幅完全消失,但它显示的是白色横幅。我以前使用过这种类型的动画并且没有问题让事情完全消失。是因为它是 iAd 横幅吗?

最佳答案

在 iAd 的 Storyboard中将 alpha 设置为 0。然后它将使用您提供的代码。

关于ios - 为什么这个 iAd 没有正常消失?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22184479/

相关文章:

iphone - 在 iPhone 操作系统上检测文件创建日期?

ios - 当用户的手指超出屏幕时,UITableView 返回错误的 indexPath

ios 无法使用 graph api 获取 facebook 的好友列表

ios - SWRevealViewController 设置前端 VC Objective-C

ios - NSArray 和 NSMutableArray 的 CFType?

iOS 9 不使用 URL SCHEME 打开 Instagram 应用程序

iOS 画外音支持组合框小部件

iOS - 使用 AFNetworking 获取图像会保留缓存

ios - 动画的楼梯animationWithDuration

ipad - 通过尺寸类别区分纵向和横向 iPad 的区别