google-mobile-ads-banner

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google Mobile Ads SDK - Banner Ads

Google Mobile Ads SDK - Banner Ads

Banner ads are rectangular image or text ads that occupy a spot within an app's layout. They remain on screen during user interaction and can refresh automatically.
横幅广告是占据应用布局中某个位置的矩形图片或文字广告。它们会在用户交互过程中保持在屏幕上,并且可以自动刷新。

Ad Placement Guidelines

广告放置指南

CRITICAL: You MUST evaluate and apply the following guidelines before proceeding with any banner ad implementation.
  • Determine Ad Placement:
    • Identify the target file where the ad should be placed. Ask if unsure.
    • Inspect view hierarchy when the target file is identified. Examine the file and determine whether the parent container of the ad is a scrollable view (such as a list, scroll view, grid) or a static, non-scrollable view.
      • Scrollable Content: Use Inline Adaptive Banner.
      • Non-Scrollable Content: Use Large Anchored Adaptive.
        • Positioning: If not specified, ask if the ad should be anchored to either the top or bottom of the screen.
重要提示: 在进行任何横幅广告实现之前,您必须评估并遵循以下指南。
  • 确定广告放置位置
    • 确定目标文件:确定应放置广告的目标文件。如有疑问,请询问。
    • 检查视图层级结构:确定目标文件后,检查该文件并确定广告的父容器是可滚动视图(如列表、滚动视图、网格)还是静态的不可滚动视图。
      • 可滚动内容:使用 Inline Adaptive Banner
      • 不可滚动内容:使用 Large Anchored Adaptive
        • 定位:如果未指定,请询问广告应锚定到屏幕的顶部还是底部

Workflow

工作流程

  1. Determine the user's platform: Identify if the project is Android or iOS. If unclear, ask before proceeding.
  2. Read the platform guide for implementation details:
    • Android:
      references/android-banner.md
    • iOS:
      references/ios-banner.md
  3. Follow these steps in order:
    • Define the ad view
    • Set the ad size
    • Register for ad load events
    • Load the banner ad
    • Verify the implementation
  4. After the banner ad is successfully implemented, remind the user to replace the test ad unit ID with their own.
  1. 确定用户的平台:确认项目是Android还是iOS。如果不确定,请在继续前询问。
  2. 阅读平台指南以获取实现细节:
    • Android:
      references/android-banner.md
    • iOS:
      references/ios-banner.md
  3. 按顺序执行以下步骤
    • 定义广告视图
    • 设置广告尺寸
    • 注册广告加载事件
    • 加载横幅广告
    • 验证实现效果
  4. 横幅广告成功实现后,提醒用户将测试广告单元ID替换为自己的正式ID。