我在我的一个 iPhone 应用程序中使用 iAd,有时当它无法加载时它会离开屏幕,这是我使用的代码:
-(void)bannerView:(ADBannerView *)aBanner didFailToReceiveAdWithError:(NSError *)error {
if (!self.bannerIsVisible) {
[UIView beginAnimations:@"animatedAdBannerOff" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0.0, -320.0);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
问题是当它没有加载时只有一个空白,我怎么会写成标签错误广告无法加载,或者类似的东西???谢谢
最佳答案
使用UIAlertView
:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Could not display iAd" delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
[alert show];
关于iphone - 如果 iAd 未加载,如何显示错误消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11778903/