踏出第一步
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
原生廣告是利用平台原生 UI 元件,向使用者顯示的廣告素材資源。從程式設計角度來說,當原生廣告載入時,應用程式會收到包含素材資源的 NativeAd
物件,並負責呈現這些素材資源,而非由 Google Mobile Ads SDK 自動處理。
這種廣告格式適合在需要靈活控制廣告外觀時使用。如果不需要這些功能,可以改用其他廣告格式。
在 Flutter 應用程式中顯示原生廣告的方式有兩種:
- 原生範本:使用預先定義的原生範本,並透過 Dart API 調整樣式:
- 平台設定:使用 Android 和 iOS 版面配置工具,自訂各平台專屬的版面配置。
原生範本
原生範本分成小型和中型兩種。每種範本都提供 UI 樣式選項,但相較於使用平台設定,自訂彈性較低。
小型範本 |
 Android
|
 iOS
|
中型範本 |
 Android
|
 iOS
|
如要瞭解如何使用 Dart 語言導入原生範本,請參閱「原生範本」。
如果想完全掌控廣告在 Android 和 iOS 平台上的外觀和風格,建議使用平台設定,但需要分別編寫兩個平台的程式碼。
如需個別平台的設定操作說明,請參閱「平台設定」。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間: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"]],["上次更新時間:2025-09-02 (世界標準時間)。"],[],["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,[]]