• <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 横幅不可点击

        iAd banner not clickable if banner moves(如果横幅移动,iAd 横幅不可点击)

                <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 横幅不可点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Resume game cocos2d(恢复游戏 cocos2d)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  Proper cocos2d scene restart?(正确的 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'>

                        <tbody id='z5IgV'></tbody>

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