我在 ADBannerView 的屏幕底部有 IBOutlet,当它显示白屏(无法加载广告)时,我不会隐藏它。
我有这个代码,但它不工作:
- (void)bannerViewDidLoadAd:(ADBannerView *)banner
{
[UIView beginAnimations:@"showAd" context:nil];
CGRect adBannerViewFrame = [bannerView frame];
adBannerViewFrame.origin.x = 160;
adBannerViewFrame.origin.y = 523;
bannerView.frame = adBannerViewFrame;
[UIView commitAnimations];
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
[UIView beginAnimations:@"hideAd" context:nil];
CGRect adBannerViewFrame = [bannerView frame];
adBannerViewFrame.origin.x = 0;
adBannerViewFrame.origin.y = 0;
bannerView.frame = adBannerViewFrame;
[UIView commitAnimations];
}
你能帮我吗,我在过去两个小时里一直在努力……:/