Admob 广告放置在选项卡视图中时不会显示

发布于 2024-09-19 07:32:27 字数 472 浏览 3 评论 0原文

我一直在尝试让我的广告以这种类型的布局展示。 选项卡 ->线性布局->列表视图->标头。标题通过 addHeaderView 设置并正常显示。如果我将广告移动到其他地方,它们会正常显示(所以这不是设置问题)。在我的其他项目中,在列表视图的标题中使用广告效果很好。

所以这似乎是一个非常具体的问题,当广告放置在 tabhost 内的列表视图的标题中时,广告只是拒绝显示。

我的日志根本没有显示来自 admob 的任何活动。这里要么是有 bug,要么是 sdk 的限制。有谁对这个问题有任何经验或见解吗?

编辑

我找到了解决方案。它实际上与我的 Tabview 根目录中的填充有关。有关更多信息,请查看我的答案此处

I've been trying to get my ads to display in this type of layout.
Tabs -> LinearLayout -> ListView -> header. The header is set via addHeaderView and is displaying normally. If I were to move the ads anywhere else they display normally (so its not a setup issue). Using ads in the header of a listview works fine in my other projects.

So this seems to be a very specific problem, the ads simply refuse to display when placed in the header of a listview inside a tabhost.

My logs show no activity from admob at all. There is either a bug here or limitation of the sdk. Does anyone have any experience or insight into this issue?

EDIT

I found the solution. It actually had to do with padding that was in the root of my Tabview. For more checkout my answer here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

缱倦旧时光 2024-09-26 07:32:54

正如我在编辑中提到的,问题与视图中的填充有关。我此处回答了另一个问题

As I mentioned in the edit, the issue has to do with padding in the views. I answered another question here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文