三星 Galaxy Tab 中的 Admob
我有一个带有 admob 横幅的应用程序,它在 Android SDK 模拟器中运行良好,但是当我在 Galaxy 选项卡中测试它时,admob 横幅不会出现... 但它确实显示在模拟器中..
I'm have an app with admob banner in it, it works fine in Android SDk emulator, but when i test it in my Galaxy tab, the admob banner doesn't come up...
but it does show in emulator..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
因为admob横幅的高度...
对于Android平板电脑,Admob的大小为90dp高度
在我的应用程序上,如果我更改admob的高度,那么在平板电脑上就可以了。
Because the height of the admob banner...
For Android Tablet, the size of the Admob is 90dp for height
On my app, if I change the height of admob, then it's ok on Tablet.
我不知道你是否已经弄清楚了,但我也遇到了同样的问题(当然,我们这里谈论的是旧的 7 英寸 Tab);我注意到
AdSize.BANNER
有效,AdSize.IAB_BANNER
不能纵向显示,只能横向显示;当我手动将广告的宽度设置为600(这是实际宽度)时,它仍然不显示。因此,查看了文档和指南,并根据指南 :
那么,根据文档,为什么
AdSize.IAB_BANNER
的宽度为 468 时却无法正常工作呢?这是因为 AdMob 在顶部应用密度计算,并且该标签高密度,横幅大小乘以 1.5,实际大小为 702,超过 600,因此不会显示任何内容。您可以手动设置宽度为 400,然后它将以适合的尺寸填充广告,即尺寸为
Adsize.BANNER
的横幅。I don't know if you figured it out yet, but i've come upon the same problem (we are talking the old 7 inch Tab here of course); I noticed that
AdSize.BANNER
works,AdSize.IAB_BANNER
doesn't show in portrait, only in landscape; when I manually set the width of the Ad to 600 (which is the actual width), it still doesn't show.Therefore looked at the docs and guide, and according to the guide:
So why doesn't the
AdSize.IAB_BANNER
work while its 468 wide according to the documentation? It is because AdMob applies density calculations on top, and since the Tab is high density, banner size gets multiplied by 1.5 such that the actual size is 702, which exceeds 600 and thus nothing will get shown.You can manually set a width of 400, then it will fill the Ad with what size it can fit, being a banner of size
Adsize.BANNER
.您是否下载了 Samsung Galaxy Tab SDK 并使用该模拟器运行了该项目?无论如何,我认为您的问题与不同的屏幕分辨率有关。尝试在更宽的屏幕上运行您的 Android 模拟器,您也将能够在您的开发环境中重现该问题。
否则,请在您的问题中添加一些代码。
格尔
Did you download Samsung Galaxy Tab SDK and ran the project with that emulator?. In any ways, i think your problem is related to different screen resolutions. Try to run your Android emulator in a wider screen and you will be able to reproduce the problem on your development environment too.
Otherwise, please add some code to your question.
Ger
这里很难回答。您可以发布您的代码片段吗?
我猜您正在使用测试设备作为模拟器。如果是这样,请添加具有正确设备 ID 的测试设备。
希望这会对您有所帮助。
It's difficult to answer here. can you please post your code snippet.
I guess you are using test device as emulator. If so please add test device with a proper device id.
Hope this will help you.