iOS-Swift Google AddMob SDK如何在UITableView的重复项目中显示不同的广告? [英] iOS - Swift Google AddMob SDK How to display different Ads in recurring items in UITableView?
问题描述
iOS-Google AddMob SDK的快速使用方法如何在UITableView的重复项目中显示不同的广告?
以下是我从 示例GoogleAdMod演示链接
当前,在每个重复项目上都显示相同的添加项,但我想在每个重复项目中显示不同的广告.
附带的屏幕截图以供参考.
Attached screenshots for reference.
Ad1:屏幕截图.
Ad2:屏幕截图.
Ad3:屏幕截图.
如何在每个重复项目中实现不同的广告?
谢谢.
推荐答案
我实际上在Objective C中做了同样的事情. 我有一个要在TableView中填充的字典数组.我在数组的每个第4个索引中插入了一个虚拟字典,这实际上是为了标识该单元格属于google Ad. 在UITableViewCell中,只需初始化GADBannerview和GADRequest,然后在-(void)adViewDidReceiveAd:(GADBannerView *)adView中查看广告时,只需重新加载UITableView的相应索引即可.
I actually did the same in Objective C. I have an array of dictionary to populate in the TableView. I inserted a dummy dictionary in every 4th index of the array , which is actually to identify that the cell belongs to google Ad. In the UITableViewCell, just initialize GADBannerview and GADRequest and when you review the Ads in - (void)adViewDidReceiveAd:(GADBannerView *)adView ,just reload the corresponding index of the UITableView.
这篇关于iOS-Swift Google AddMob SDK如何在UITableView的重复项目中显示不同的广告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!