iAd显示在标签栏ibn iOS7下面

时间:2013-09-22 20:12:32

标签: ios7 xcode5 iad tabbar tabbarcontroller

我的iAd在iOS 6应用程序中工作正常,它们会显示在标签栏上方并且工作得非常好;但是对于iOS7和Xcode 5,我的广告会显示在标签栏下方。我知道它会加载应用程序,因为我可以看到'bannerViewDidLoadAd'并且标签栏的顶部会出现一条非常简洁的线条。

我还下载了Apple iAdSuite,标签栏示例完全相同!

请问有人可以帮助解决为什么广告出现在标签栏下方而不是在标签栏上方?

对不起我设置框架的代码:

`- (void)viewDidLayoutSubviews
{
CGRect contentFrame = self.view.bounds, bannerFrame = CGRectZero;
ADBannerView *bannerView = [BannerViewManager sharedInstance].bannerView;

// If configured to support iOS >= 6.0 only, then we want to avoid
// currentContentSizeIdentifier as it is deprecated.
// Fortunately all we need to do is ask the banner for a size that fits into the layout
// area we are using. At this point in this method contentFrame=self.view.bounds,
// so we'll use that size for the layout.
//
bannerFrame.size = [bannerView sizeThatFits:contentFrame.size];

if (bannerView.bannerLoaded) {
    contentFrame.size.height -= bannerFrame.size.height;
    bannerFrame.origin.y = contentFrame.size.height;
} else {
    bannerFrame.origin.y = contentFrame.size.height;
}
self.contentController.view.frame = contentFrame;

// We only want to modify the banner view itself if this view controller is actually
// visible to the user. This prevents us from modifying it while it is being displayed elsewhere.
//
if (self.isViewLoaded && (self.view.window != nil)) {
    [self.view addSubview:bannerView];
    bannerView.frame = bannerFrame;
}
[self.view layoutSubviews];
}

- (void)updateLayout
{
    [UIView animateWithDuration:0.25 animations:^{
        [self.view setNeedsLayout];
        [self.view layoutIfNeeded];
    }];
}`

1 个答案:

答案 0 :(得分:4)

在要添加iAds面板的视图的属性检查器上,在“延伸边缘”部分中选中了“底部条形条形图”或“不透明条形条形图”。取消选中它们可能会解决您的问题。这些是iOS 7的新设置。