adWhirl的actualadsize方法没有返回正确的信息
我正在对此进行测试:
CGSize adSize = [adWhirlView actualAdSize];
NSLog(@"ad size received: %f x %f",adSize.width, adSize.height);
但是,返回的宽度始终是设备方向的宽度,无论广告实际上是什么样子。这主要是 adMob 的问题,因为它的广告可能远小于设备的宽度,因此显示为左齐平而不是居中,即使上面返回的 adsize
实际上显示的广告应该是全宽。
还有其他人遇到过这种情况并对如何处理有建议吗?如果您不知道广告的实际宽度,则无法真正将其正确居中。
I am testing with this:
CGSize adSize = [adWhirlView actualAdSize];
NSLog(@"ad size received: %f x %f",adSize.width, adSize.height);
However, the width that is returned is always the width of the device orientation, no matter what the ad actually looks like. This is primarily an issue with adMob because its ads may be much less than the device's width and thus appear as flush left instead of centered, even though the adsize
returned above is actually showing the ads are supposed to be full width.
Anyone else encountered this and have a suggestion on how to deal with it? If you don't know an ad's actual width, you cannot really center it properly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题出在 AdMob 适配器中:
这是一个非常糟糕的实现,因为 AdWhirl 缺少可选的委托方法。虽然这很容易解决。只需使用 AdMobs 横幅尺寸之一即可,一切都会正常:
您可能还想修复颜色。有两个与颜色有关的错误:
要解决此问题,只需找到与颜色相关的代码(位于 getAd() 的开头)并将其替换为:
The problem is located in the AdMob adapter:
This is a very lousy implementation since AdWhirl is lacking optional delegate methods here. Though this is pretty easy to fix. Simple use one of AdMobs banner sizes and everything will work:
You probably want to fix colors too. There are two bugs concerning colors:
To fix this, simply locate the code related to colors (right at the beginning of getAd()) and replace it with:
我有同样的问题。
我有 adWhirl 和 iAd & AdMob 广告已启用,我的做法如下:
…………
I have the same problem.
I have adWhirl with iAd & AdMob ads enabled and I made like this:
........