gpt4 book ai didi

iphone - 将 UITableView 中的 iAd 与静态单元格集成

转载 作者:行者123 更新时间:2023-12-03 21:16:07 25 4
gpt4 key购买 nike

我希望能够将 iAd 集成到我的主详细信息应用程序的详细信息 View 中。详细 View 是一个 UITableView,其中有一个显示一些数据的静态表。我在互联网上找到的所有教程都是通过使用包含 UITableView 的 UIView 将 iAd 放在表格的底部。不幸的是,我不能这样做,因为静态表必须位于 UITableView 中。所以我被困住了。由于这更多的是一个概念问题,我实际上没有任何代码要发布,但如果你告诉我要发布什么,我就可以。提前致谢,布拉德. :)

最佳答案

我总是在 View “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

关于iphone - 将 UITableView 中的 iAd 与静态单元格集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13093842/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com