2013-09-22 83 views
2

我的iAds在我的iOS 6應用程序中正常工作,它們會出現在標籤欄上方並且工作絕對正常;然而在iOS7和Xcode 5中,我的廣告出現在標籤欄下方。我知道它會加載應用程序,因爲我可以看到「bannerViewDidLoadAd」,並且標籤欄頂部出現一個非常不合適的行。iAds在標籤欄ibn下顯示iOS7

我也下載了蘋果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]; 
    }]; 
}` 
+0

介意向我們展示設置iAd的「幀」的代碼?有很多原因可能會發生這種情況... –

+0

對不起,我已經添加了我的代碼。非常感謝 –

回答

4

在屬性檢查器在其中添加了網絡成癮潘內爾的觀點是在底部的酒吧或在不透明酒吧的擴展邊緣部分進行檢查。取消選中它們可能會解決您的問題。這些是適用於iOS 7的新設置。

+0

這工作,以前從未見過。非常感謝! –

+0

@KevinTarr沒問題。升級到iOS7後,我的iOS 4應用完全被此功能破壞。 –