折叠式横幅广告
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
折叠式横幅广告最初会以较大的叠加层形式展示,并提供一个可将其收起为最初请求的横幅广告尺寸的按钮。折叠式横幅广告旨在提升锚定广告(否则尺寸会较小)的效果。本指南介绍了如何为现有横幅广告展示位置启用可收起的横幅广告。

前提条件
实现
请确保您的横幅广告视图是按照您希望用户在常规(已收起)横幅广告状态下看到的尺寸定义的。在广告请求中添加一个 extras 参数,其中 collapsible
为键,广告展示位置为值。
折叠式展示位置定义了展开区域如何锚定到横幅广告。
Placement 值
|
行为 |
预期使用情形 |
top |
展开式广告的顶部与收拢式广告的顶部对齐。 |
广告位于屏幕顶部。 |
bottom |
展开的广告的底部与收拢的广告的底部对齐。 |
广告位于屏幕底部。 |
如果加载的广告是可收缩的横幅广告,则该横幅广告在放置到视图层次结构中后会立即显示可收缩的叠加层。
private void LoadBannerAd()
{
var bannerView = new BannerView(_adUnitId, AdSize.Banner, AdPosition.Bottom);
var adRequest = new AdRequest();
// Create an extra parameter that aligns the bottom of
// the expanded ad to the bottom of the bannerView.
adRequest.Extras.Add("collapsible", "bottom");
bannerView.LoadAd(adRequest);
}
广告刷新行为
对于在 AdMob 网页界面中为横幅广告配置了自动刷新的应用,当为横幅广告位请求折叠式横幅广告时,后续的广告刷新不会再请求折叠式横幅广告。这是因为在每次刷新时都显示折叠式横幅广告可能会对用户体验产生负面影响。
如果想在会话中的稍晚时间再加载一个折叠式横幅广告,您可以使用包含 collapsible 参数的请求手动加载广告。
检查已加载的广告是否可收起
非折叠式横幅广告符合条件,可以针对折叠式横幅广告请求返回,从而最大限度地提升广告效果。调用 isCollapsible
以检查加载的最后一个横幅是否可收起。如果请求未能加载,且之前的横幅可收起,则 API 会返回 true。
_bannerView.OnBannerAdLoaded += () =>
{
Debug.Log(_bannerView.IsCollapsible()
? "Banner is collapsible."
: "Banner is not collapsible.");
};
折叠式横幅广告仅适用于 Google 需求。通过中介投放的广告会显示为常规的不可收起的横幅广告。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-24。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-24。"],[[["Collapsible banner ads start as larger overlays and can be collapsed to a standard banner size, improving the performance of smaller, anchored ads."],["To implement, define the collapsed banner size, and include an extra parameter in the ad request specifying the placement (top or bottom) for the expanded overlay."],["Auto-refresh is disabled for collapsible banner ads after the initial load to avoid impacting user experience; manually load them again with the collapsible parameter if needed."],["Verify if a loaded ad is collapsible using `isCollapsible` as non-collapsible ads might be served to ensure ad delivery."],["Currently, only Google demand supports collapsible banner ads during the beta period; mediated ads will display as regular banners."]]],["Collapsible banner ads expand from a smaller banner size to a larger overlay. To implement, define the desired collapsed banner size and include an \"extras\" parameter in the ad request with \"collapsible\" as the key and the ad's placement (\"top\" or \"bottom\") as the value. Expanded region anchors to the banner ad based on the specified placement. Subsequent ad refreshes won't be collapsible by default. Developers can check if the loaded ad is collapsible using `isCollapsible`. These ads are exclusive to Google demand.\n"]]