开始使用
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
原生广告是通过平台原本就有的界面组件向用户呈现的广告素材资源。在编码层面,这意味着当原生广告加载时,您的应用会收到一个包含素材资源的 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-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\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,["# Get started\n\nSelect platform: [Android](/ad-manager/mobile-ads-sdk/android/native \"View this page for the Android platform docs.\") [iOS](/ad-manager/mobile-ads-sdk/ios/native \"View this page for the iOS platform docs.\") [Flutter](/ad-manager/mobile-ads-sdk/flutter/native \"View this page for the Flutter platform docs.\") [Unity](/ad-manager/mobile-ads-sdk/unity/native-overlay \"View this page for the Unity platform docs.\")\n\n\u003cbr /\u003e\n\nNative ads are ad assets presented to users with UI components native to the\nplatform. In coding terms, this means that when a native ad loads, your app\nreceives a `NativeAd` object that contains its assets, and your app---rather\nthan the Google Mobile Ads SDK---is then responsible for displaying them.\n\nThis ad format is for when you want more control to style the look of your ads.\nIf you don't need these features, use one of our other ad formats.\n\nThere are two ways to display native ads in your Flutter app:\n\n- **Native templates:** Pre-defined native templates styled with a Dart API.\n- **Platform setup:** Custom platform-specific layouts defined using Android and iOS layout tools.\n\nNative templates\n----------------\n\nThere are two template types to choose from: small or medium. Each template\ncomes with UI styling options; however, they offer less customization than\nthe platform setup implementation.\n\n| Small |\n|-------------|---------|\n| **Android** | **iOS** |\n| **Android** | **iOS** |\n\nFor native templates implementation details in Dart, see [Native\ntemplates](/ad-manager/mobile-ads-sdk/flutter/native/templates).\n\nPlatform setup\n--------------\n\nPlatform setup is better when you need complete control of the look and feel for\nyour ads on both Android and iOS platforms, but you'll need to write code for\nboth.\n\nFor platform-specific setup instructions, see [Platform\nsetup](/ad-manager/mobile-ads-sdk/flutter/native/platforms)."]]