开始使用
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
原生广告是通过平台原本就有的界面组件向用户呈现的广告素材资源。具体到代码编写层面,这意味着当原生广告加载时,您的应用会收到一个包含其素材资源的 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 native UI components.\u003c/p\u003e\n"],["\u003cp\u003eChoose between Native Templates for pre-defined layouts with styling options or Platform Setup for complete customization using Android/iOS tools.\u003c/p\u003e\n"],["\u003cp\u003eNative Templates offer small and medium sizes with some UI customization, while Platform Setup provides full control but requires platform-specific code.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the provided links for detailed implementation instructions on both Native Templates and Platform Setup for Flutter.\u003c/p\u003e\n"]]],["Native ads allow apps to display ad assets using native UI components. Apps receive a `NativeAd` object and handle asset display. There are two implementation methods: native templates and platform setup. Native templates offer pre-defined small or medium designs with some styling options. Platform setup provides full control over ad appearance on Android and iOS but requires platform-specific code. Native templates are detailed in the linked section and so are the platform specific set up.\n"],null,["# Get started\n\nSelect platform: [Android](/admob/android/native \"View this page for the Android platform docs.\") [iOS](/admob/ios/native \"View this page for the iOS platform docs.\") [Flutter](/admob/flutter/native \"View this page for the Flutter platform docs.\") [Unity](/admob/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](/admob/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](/admob/flutter/native/platforms)."]]