我创建了横幅:
bannerView = GADBannerView(adSize: kGADAdSizeSmartBannerPortrait)
bannerView.adUnitID = "ca-76543456707"
bannerView.delegate = self
它应该是全宽,我将它添加到带有前导、拖尾、顶部和底部约束的 View 中。对于大多数广告,结果是全宽。但对某些人来说则不然。为什么? 这是一个示例: 奥 git _a 红色是 View 的颜色。
如何使其全宽?
最佳答案
Typically, Smart Banners on phones have a height of 50dp in portrait and 32dp in landscape. On tablets, height is normally 90dp in both orientations.
When an image ad isn't large enough to take up the entire allotted space, the image will be centered, and the space on either side will be filled in.
您还可以在 AppStore 上查看实时应用程序,您会注意到在较大宽度的设备上它们也显示 320 宽度。
关于iOS:Admob 智能横幅不占据全宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45846554/