【问题标题】:Why does a ADBannerView positioned at the bottom of the screen jumps to the top after exiting the full screen ad?为什么位于屏幕底部的 ADBannerView 在退出全屏广告后会跳到顶部?
【发布时间】:2011-07-18 15:52:02
【问题描述】:

我已将 ADBannerView 添加到我的视图(在代码中)并将其定位在屏幕底部。工作正常。

但是,在用户点击广告并全屏打开后,当他们关闭它时,横幅会出现在顶部。我可以再次将它移回

- (void)bannerViewActionDidFinish:(ADBannerView *)banner

问题是广告在移动到正确位置之前在顶部短暂可见。

有什么想法吗?

【问题讨论】:

    标签: iphone ios4


    【解决方案1】:

    我找到了解决方法如下:

    - (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave
    {
    
        self.superView = banner.superview;
        [banner removeFromSuperview];
        [self.superView insertSubview:banner atIndex:0];
    
    
        return YES;
    }
    
    
    - (void)bannerViewActionDidFinish:(ADBannerView *)banner
    {
        [self positionBanner:banner];
    
        [banner removeFromSuperview];
        [self.superView addSubview:banner];
    
    }
    

    因此,基本上,我们会在用户点击广告时从其超级视图中移除横幅,然后在操作完成时重新添加回其超级视图。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-01-26
      • 1970-01-01
      • 1970-01-01
      • 2015-09-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-23
      相关资源
      最近更新 更多