2

I want to be able to integrate an iAd into the detail view of my master detail application. The detail view is a UITableView with a static table displaying some data. All of the tutorials I've found on the Internet put the iAd at the bottom of the table by using a UIView containing a UITableView. Unfortunately, I can't do that because a static table must be in a UITableView. So I'm stuck. Since this is more of a conceptual problem, I don't really have any code to post, but if you tell me what to post I can. Thanks in advance, Brad. :)

4

1 回答 1

1

我总是将这段代码插入到Did Load视图中,它将iad放在最上面。看看这是否有效,如果您需要整套 .h 和 .m 文件,请告诉我,我会为您发布。

adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.frame = CGRectOffset(adView.frame, 0, -50);
adView.requiredContentSizeIdentifiers = [NSSet setWithObjects:ADBannerContentSizeIdentifierPortrait,ADBannerContentSizeIdentifierLandscape,nil];
if (UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) {
    adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
}else
{
    adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
}
[self.view addSubview:adView];
adView.delegate=self;
self.bannerIsVisible=NO;

我希望它有所帮助,如果您需要整套代码,请告诉我。阿德里安

这是一个教程的链接,它完全符合您的要求,那里还有一个示例项目向您展示它是如何工作的。

http://useyourloaf.com/blog/2010/09/16/placing-iad-banners-at-the-top-of-a-table-view.html

于 2012-10-26T20:40:02.213 回答