开始使用
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
原生广告是通过平台原本就有的界面组件向用户呈现的广告素材资源。在编码层面,这意味着当原生广告加载时,您的应用会收到一个包含素材资源的 NativeAd
对象,然后您的应用(而非 Google 移动广告 SDK)会负责展示该对象。
如果您想更好地控制广告的外观样式,可以使用此广告格式。如果您不需要这些功能,请使用我们的其他广告格式。
您可以通过以下两种方式在 Flutter 应用中展示原生广告:
- 原生广告模板:使用 DART API 设置样式的预定义原生广告模板。
- 平台设置:使用 Android 和 iOS 版式工具定义的自定义平台专用版式。
原生广告模板
有两种模板类型可供选择:小或中等。每个模板都附带界面样式选项;不过,与平台设置实现相比,这些选项提供的自定义功能较少。
小 |
 Android
|
 iOS
|
中等 |
 Android
|
 iOS
|
如需详细了解如何在 Dart 中实现原生广告模板,请参阅原生广告模板。
如果您需要完全控制广告在 Android 和 iOS 平台上的外观和风格,最好选择平台设置,但您需要针对这两个平台编写代码。
如需查看针对具体平台的设置说明,请参阅平台设置。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-09-02。
[[["易于理解","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-09-02。"],[[["\u003cp\u003eNative ads give you control over the ad's look and feel by providing ad assets that your app displays using its own UI components.\u003c/p\u003e\n"],["\u003cp\u003eYou can implement native ads using pre-defined templates with styling options or with platform-specific custom layouts for maximum control.\u003c/p\u003e\n"],["\u003cp\u003eNative templates offer small and medium size options with some styling flexibility while platform setup requires Android and iOS code for full customization.\u003c/p\u003e\n"]]],[],null,[]]