gpt4 book ai didi

ios - 失败时隐藏 iAdBanner 并尝试显示我自己的按钮时出错 Xcode iOS7

转载 作者:行者123 更新时间:2023-11-29 12:43:43 26 4
gpt4 key购买 nike

您好,我想在 iAdBanner 失败时隐藏它,我想用我的其他 URL itunes 应用程序显示我自己的按钮,但它在 iOS 7 上不起作用。有人可以帮助我吗?谢谢!

(iAd 横幅广告正常工作)。

我的代码是:

- (void)viewDidLoad {
[super viewDidLoad];
_myBanner.hidden = TRUE;
_myBanner.enabled = FALSE;
}

-(void)bannerViewDidLoadAd:(ADBannerView *)banner {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[banner setAlpha:1];
[UIView commitAnimations];
}

- (void)bannerView:(ADBannerView *) banner didFailToReceiveAdWithError:(NSError *)error
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[banner setAlpha:0];
[UIView commitAnimations];

if (_adBannerViewIsVisible) {

_adBannerViewIsVisible = NO;
[self fixupAdView:[UIDevice currentDevice].orientation]; /*This doesn't work*/
}

_myBanner.hidden = FALSE;
_myBanner.enabled = TRUE;

[ADBannerView removeFromSuperview]; /*This doesn't work*/
[ADBannerView release]; /*This doesn't work*/

}

- (IBAction)tapBanner:(id)sender
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@""]];
}

最佳答案

     - (void)bannerView:(ADBannerView *) banner didFailToReceiveAdWithError:(NSError *)error
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[banner setAlpha:0];
[UIView commitAnimations]; _myBanner.hidden = YES;

_myBanner.enabled = NO;
[_myBanner removeFromSuperview];
[_myBanner release];
}

关于ios - 失败时隐藏 iAdBanner 并尝试显示我自己的按钮时出错 Xcode iOS7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24201074/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com