• <small id='6YMc9'></small><noframes id='6YMc9'>

          <bdo id='6YMc9'></bdo><ul id='6YMc9'></ul>

      1. <legend id='6YMc9'><style id='6YMc9'><dir id='6YMc9'><q id='6YMc9'></q></dir></style></legend>
      2. <tfoot id='6YMc9'></tfoot>
        <i id='6YMc9'><tr id='6YMc9'><dt id='6YMc9'><q id='6YMc9'><span id='6YMc9'><b id='6YMc9'><form id='6YMc9'><ins id='6YMc9'></ins><ul id='6YMc9'></ul><sub id='6YMc9'></sub></form><legend id='6YMc9'></legend><bdo id='6YMc9'><pre id='6YMc9'><center id='6YMc9'></center></pre></bdo></b><th id='6YMc9'></th></span></q></dt></tr></i><div id='6YMc9'><tfoot id='6YMc9'></tfoot><dl id='6YMc9'><fieldset id='6YMc9'></fieldset></dl></div>

        如果横幅移动,iAd 横幅不可点击

        时间:2024-08-12

                <bdo id='ekBU4'></bdo><ul id='ekBU4'></ul>
              • <legend id='ekBU4'><style id='ekBU4'><dir id='ekBU4'><q id='ekBU4'></q></dir></style></legend>
                  <tbody id='ekBU4'></tbody>

                <small id='ekBU4'></small><noframes id='ekBU4'>

                  <tfoot id='ekBU4'></tfoot>
                • <i id='ekBU4'><tr id='ekBU4'><dt id='ekBU4'><q id='ekBU4'><span id='ekBU4'><b id='ekBU4'><form id='ekBU4'><ins id='ekBU4'></ins><ul id='ekBU4'></ul><sub id='ekBU4'></sub></form><legend id='ekBU4'></legend><bdo id='ekBU4'><pre id='ekBU4'><center id='ekBU4'></center></pre></bdo></b><th id='ekBU4'></th></span></q></dt></tr></i><div id='ekBU4'><tfoot id='ekBU4'></tfoot><dl id='ekBU4'><fieldset id='ekBU4'></fieldset></dl></div>
                  本文介绍了如果横幅移动,iAd 横幅不可点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个 iAd 横幅在 Cocos2d 应用程序中工作.

                  I have an iAd banner working in a Cocos2d app.

                  这是我为展示广告而制作的 CCLayer 子类的代码.在 DidLoad 上,添加变得可见,底部菜单向上滑动以进行补偿.

                  Here's the code for a CCLayer subclass I made to show ads. On DidLoad, the add becomes visible and the bottom menu slides up to compensate.

                  -(id) init
                  {
                      if( (self=[super init]) ) {
                          CGSize size = [[CCDirector sharedDirector] winSize];
                  
                          UIViewController *controller = [[UIViewController alloc] init];
                          controller.view.frame = CGRectMake(0, size.height -32, 320, 32);
                  
                          ADBannerView *adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
                  
                          adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierLandscape];
                  
                          adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
                          [controller.view addSubview:adView];
                          adView.delegate = self;
                  
                          [[[CCDirector sharedDirector] view] addSubview:controller.view];
                          [[[CCDirector sharedDirector] view] setNeedsLayout]; // I was told this would fix it, but it fails to.
                      }
                  
                      return self;
                  }
                  
                  
                  - (void)bannerViewDidLoadAd:(ADBannerView *)banner
                  {
                      if (!bannerIsVisible)
                      {
                          NSLog(@"bannerViewDidLoadAd");
                          [UIView beginAnimations:@"animateAdBannerOn" context:NULL];
                          banner.frame = CGRectOffset(banner.frame, 0, -32); //the offending line
                  
                          self.position = ccpAdd(ccp(0, 32), self.position);
                  
                          [UIView commitAnimations];
                          bannerIsVisible = YES;
                  
                  
                      }
                  }
                  - (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
                  {
                      if (bannerIsVisible)
                      {
                          NSLog(@"bannerView:didFailToReceiveAdWithError:");
                          [UIView beginAnimations:@"animateAdBannerOff" context:NULL];
                          banner.frame = CGRectOffset(banner.frame, 0, 32); //the other offending line
                          self.position = ccpAdd(ccp(0, -32), self.position);
                  
                          [UIView commitAnimations];
                          bannerIsVisible = NO;
                      }
                  
                  }
                  

                  当这些行被禁用时,横幅是可点击的,但丑陋的白色横幅是可见的.这是怎么回事?我该如何解决或绕过它?

                  When those lines are disabled, the banner is clickable, but the ugly white banner is visible. What's up with this? How do I fix or get around it?

                  推荐答案

                  Cocos2d_2.0_iAd_Sample

                  Cocos2d_3.0_iAd_Sample

                  在你的场景中这样做.

                  -(void)onEnter
                  {
                  [superonEnter];
                  
                  mIAd=[[MyiAdalloc]init];
                  
                  }
                      
                  -(void)play
                  {
                      [self hideAdsBanner];
                  }
                  

                  -(void)hideAdsBanner
                  {
                  if(mIAd)
                  [mIAdRemoveiAd];
                  
                  }
                  
                  -(void)onExit
                  {
                  if(mIAd)
                  {
                  [mIAdrelease];
                  mIAd=nil;
                  }
                  [superonExit];
                  
                  }
                  

                  这篇关于如果横幅移动,iAd 横幅不可点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 COCOS2d Android 中使用 CClistview? 下一篇:Cocos2d - 设置设备/屏幕方向

                  相关文章

                  <i id='z5IgV'><tr id='z5IgV'><dt id='z5IgV'><q id='z5IgV'><span id='z5IgV'><b id='z5IgV'><form id='z5IgV'><ins id='z5IgV'></ins><ul id='z5IgV'></ul><sub id='z5IgV'></sub></form><legend id='z5IgV'></legend><bdo id='z5IgV'><pre id='z5IgV'><center id='z5IgV'></center></pre></bdo></b><th id='z5IgV'></th></span></q></dt></tr></i><div id='z5IgV'><tfoot id='z5IgV'></tfoot><dl id='z5IgV'><fieldset id='z5IgV'></fieldset></dl></div>
                  <legend id='z5IgV'><style id='z5IgV'><dir id='z5IgV'><q id='z5IgV'></q></dir></style></legend>

                  <tfoot id='z5IgV'></tfoot>
                • <small id='z5IgV'></small><noframes id='z5IgV'>

                        <bdo id='z5IgV'></bdo><ul id='z5IgV'></ul>