โฆษณาแบนเนอร์ขนาดคงที่
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เลือกแพลตฟอร์ม:
Android
iOS
Flutter
Google Mobile Ads SDK รองรับขนาดโฆษณาคงที่สำหรับกรณีที่โฆษณาแบนเนอร์แบบปรับขนาดได้ไม่ตรงกับความต้องการของคุณ
ตารางต่อไปนี้แสดงขนาดแบนเนอร์มาตรฐาน
ขนาดในหน่วย dp (กว้างxสูง) |
คำอธิบาย |
ความพร้อมใช้งาน |
ค่าคงที่ AdSize |
320x50 |
ป้ายประกาศ |
โทรศัพท์และแท็บเล็ต |
GADAdSizeBanner |
320x100 |
แบนเนอร์ขนาดใหญ่ |
โทรศัพท์และแท็บเล็ต |
GADAdSizeLargeBanner |
300x250 |
สี่เหลี่ยมผืนผ้าขนาดกลางของ IAB |
โทรศัพท์และแท็บเล็ต |
GADAdSizeMediumRectangle |
468x60 |
แบนเนอร์ขนาดเต็มของ IAB |
แท็บเล็ต |
GADAdSizeFullBanner |
728x90 |
ลีดเดอร์บอร์ดของ IAB |
แท็บเล็ต |
GADAdSizeLeaderboard |
หากต้องการกำหนดขนาดแบนเนอร์ที่กำหนดเอง ให้ตั้งค่าขนาดโดยใช้ GADAdSizeFromCGSize
ดังนี้
Swift
let adSize = adSizeFor(cgSize: CGSize(width: 250, height: 250))
Objective-C
GADAdSize size = GADAdSizeFromCGSize(CGSizeMake(250, 250));
ตัวอย่างโฆษณาแบนเนอร์ขนาดคงที่
Swift
Objective-C
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-09-02 UTC
[null,null,["อัปเดตล่าสุด 2025-09-02 UTC"],[[["\u003cp\u003eThe Google Mobile Ads SDK offers fixed ad sizes as an alternative to adaptive banners.\u003c/p\u003e\n"],["\u003cp\u003eStandard banner sizes include Banner (320x50), Large Banner (320x100), IAB medium rectangle (300x250), IAB full-size banner (468x60), and IAB leaderboard (728x90), each with specified availability for phones and/or tablets.\u003c/p\u003e\n"],["\u003cp\u003eCustom banner sizes can be defined using \u003ccode\u003eGADAdSizeFromCGSize\u003c/code\u003e by providing the desired width and height.\u003c/p\u003e\n"],["\u003cp\u003eCode examples for implementing fixed size banner ads are available in both Swift and Objective-C.\u003c/p\u003e\n"]]],["The Google Mobile Ads SDK supports fixed-size banner ads with standard sizes for phones and tablets. Available sizes include 320x50 (Banner), 320x100 (Large banner), 300x250 (IAB medium rectangle), 468x60 (IAB full-size banner), and 728x90 (IAB leaderboard), each with a corresponding `GADAdSize` constant. Custom sizes can be set using `GADAdSizeFromCGSize`, demonstrated in Swift and Objective-C examples provided in the documentation.\n"],null,["Select platform: [Android](/admob/android/banner/fixed-size \"View this page for the Android platform docs.\") [iOS](/admob/ios/banner/fixed-size \"View this page for the iOS platform docs.\") [Flutter](/admob/flutter/banner/fixed-size \"View this page for the Flutter platform docs.\")\n\n\u003cbr /\u003e\n\nThe Google Mobile Ads SDK supports fixed ad sizes for situations where adaptive\nbanners ads don't meet your needs.\n\nThe following table lists the standard banner sizes.\n\n| Size in dp (WxH) | Description | Availability | AdSize constant |\n|------------------|----------------------|--------------------|----------------------------|\n| 320x50 | Banner | Phones and tablets | `GADAdSizeBanner` |\n| 320x100 | Large banner | Phones and tablets | `GADAdSizeLargeBanner` |\n| 300x250 | IAB medium rectangle | Phones and tablets | `GADAdSizeMediumRectangle` |\n| 468x60 | IAB full-size banner | Tablets | `GADAdSizeFullBanner` |\n| 728x90 | IAB leaderboard | Tablets | `GADAdSizeLeaderboard` |\n\nTo define a custom banner size, set your size using [`GADAdSizeFromCGSize`](/admob/ios/api/reference/Functions): \n\nSwift \n\n let adSize = adSizeFor(cgSize: CGSize(width: 250, height: 250))\n\nObjective-C \n\n GADAdSize size = GADAdSizeFromCGSize(CGSizeMake(250, 250));\n\nFixed size banner ads example\n\n[Swift](//github.com/googleads/googleads-mobile-ios-examples/blob/main/Swift/advanced/APIDemo/APIDemo/AdMobBannerSizesViewController.swift)\n[Objective-C](//github.com/googleads/googleads-mobile-ios-examples/blob/main/Objective-C/advanced/APIDemo/APIDemo/AdMobBannerSizesViewController.m)"]]