我正在嘗試在我的一個現有應用程序中實現iAd。它的工作原理,但我不斷收到錯誤消息:ADBannerView:警告橫幅視圖有一個廣告,但可能會被遮蓋。此消息僅在每個橫幅視圖中打印一次。iAd警告 - 被遮擋的橫幅視圖
廣告被遮擋或可能被遮擋?代碼有問題嗎?我無法弄清楚。我會承認是一個新手。任何幫助將不勝感激。謝謝你看我的問題。
- (void)createBannerView {
Class cls = NSClassFromString(@"ADBannerView");
if (cls) {
ADBannerView *adView = [[[cls alloc] initWithFrame:CGRectZero]autorelease];
adView.currentContentSizeIdentifier =ADBannerContentSizeIdentifierPortrait;
adView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin |UIViewAutoresizingFlexibleBottomMargin| UIViewAutoresizingFlexibleRightMargin |UIViewAutoresizingFlexibleLeftMargin;
adView.delegate = self;
CGRect bannerFrame =adView.frame;
bannerFrame.origin.y = self.view.frame.size.height;
adView.frame = bannerFrame;
adView.frame = CGRectOffset(adView.frame, 0, -50);
self.bannerView = adView;
[self.view addSubview:adView];
}
}
- (void)showBanner {
CGFloat fullViewHeight = self.view.frame.size.height;
CGRect tableFrame = self.tView.frame;
CGRect bannerFrame = self.bannerView.frame;
tableFrame.size.height = fullViewHeight - bannerFrame.size.height;
bannerFrame.origin.y = fullViewHeight - bannerFrame.size.height;
[UIView beginAnimations:@"showBanner" context:NULL];
self.tView.frame = tableFrame;
self.bannerView.frame = bannerFrame;
[UIView commitAnimations];
}
我有同樣的問題,然後我看了這個YouTube視頻,看到我不得不添加的一面旗幟,並將其連接的他在視頻中顯示的方式,併爲我工作。希望這可以幫助! http://www.youtube.com/watch?v=hLpgL6K1vM4 – user961632