0
我在可能的应用中使用AdMobs智能横幅广告,除了横幅广告尺寸未修正320x50
及其screen widthx50
之外,我做了所有建议。在自动布局中,我添加了1个水平中心约束和1个屏幕宽度约束。如果我运行模拟器上我的伟大工程,但在设备上,我得到这个错误:Swift AdMob广告尺寸错误
<Google> Unable to set adSize property. Not enough space to show ad with custom size, {600, 50}. Please use a size that fits the current screen bounds of {320, 568}.
<Google> To get test ads on this device, call: request.testDevices = @[ @"bb3f8f97887" ];
<Google> Unable to set adSize property. Not enough space to show ad with custom size, {600, 50}. Please use a size that fits the current screen bounds of {320, 568}.
<Google> Invalid Request. Ad size will not fit on screen
如果我登录我得到这个GADBannerView的视图大小(在iPhone 5上运行):
Size: (0.0, 0.0, 320.0, 50.0)
这是我的代码:
@IBOutlet weak var bannerView: GADBannerView!
bannerView.adUnitID = "ca-app-pub-394/216"
bannerView.adSize = kGADAdSizeSmartBannerPortrait
bannerView.rootViewController = self
print("Size: ",bannerView.bounds)
bannerView.loadRequest(GADRequest())
这是我的约束
对宽度没有限制。 – TheValyreanGroup
Lol没问题。它总是小事。 – TheValyreanGroup