【发布时间】:2021-01-16 09:37:38
【问题描述】:
我对 admob nativeads 很陌生,我检查了每个教程 网上关于如何在tableview中添加广告,但我没有找到任何运气 这是迄今为止我在 cellforrowat 函数中的代码:
let cell = Bundle.main.loadNibNamed("NativeAdTableViewCell", owner: self, options: nil)?.first as! NativeAdTableViewCell
print("ad = \(ad == nil)")
cell.adTitle.text = ad?.headline
cell.adSubtitle.text = ad?.body
cell.img.image = ad?.icon?.image
cell.selectionStyle = UITableViewCell.SelectionStyle.none
return cell
其他代码:
func adLoader(_ adLoader: GADAdLoader, didReceive nativeAd: GADUnifiedNativeAd) {
nativeAd.delegate = self
ad = nativeAd
}
在此感谢您
【问题讨论】:
标签: ios swift xcode admob tableview