本文介绍了iAd横幅无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

因此,我使用了一个教程来在屏幕底部创建一个iAd标语,并将其设置为在窗口中和窗口外设置动画,但是该应用基于标签,而且我不太清楚正确的偏移量,因此您可以告诉我,我将不胜感激,但是主要的问题是,adBanner并不总是出现,并且有时它只是一个白框。这是我的代码。
在我的.h

SO I used a tutorial to create an iAd Banner at the bottom of the screen and animate it into and out of the window, however the app is a tab based, and i do not quite know the correct offset, so you could tell me I would appreciate it, however the primary problem, is that the adBanner does not always appear, and when it does sometimes it is just a white box. Here is my code.In my .h

@interface section3 <ADBannerViewDelegate>{
    ADBannerView *adView;
    BOOL bannerIsVisible;
}
@property (nonatomic, assign) BOOL bannerIsVisible;
//in the .m     in the view did load

adView  = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.frame = CGRectOffset(adView.frame, 0.0, 410.0f);
adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
[self.view addSubview:adView];
adView.delegate = self;
self.bannerIsVisible = NO;
-(void)bannerViewDidLoadAd:(ADBannerView *)banner{

    if (!self.bannerIsVisible) {
        [UIView beginAnimations:@"animateAdBannerOn" context:NULL];
        banner.frame = CGRectOffset(banner.frame, 0.0, -50.0f);
        [UIView commitAnimations];
        self.bannerIsVisible = YES;

    }
}

-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{

    if (self.bannerIsVisible) {
        [UIView beginAnimations:@"animateAdBannerOff" context:NULL];
        banner.frame = CGRectOffset(banner.frame, 0.0, 50.0f);
        [UIView commitAnimations];
        self.bannerIsVisible = NO;

    }

}

我正在使用Xcode 4.2.1
非常感谢,我们将不胜感激:)

I am using Xcode 4.2.1Thank you very much, any help would be appreciated :)

推荐答案

该标签栏高度为44px因此,您必须将其添加到 50 44之一中,并使410达到3.5英寸的全屏尺寸,即默认为480。那应该是解决方案。

The tabbar is 44px high so u must add to one of the "50" 44 and make 410 to the full screen size of 3.5 inch means to 480 default. That should be the solution.

这篇关于iAd横幅无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 08:14