แบนเนอร์อัจฉริยะ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แบนเนอร์อัจฉริยะคือหน่วยโฆษณาที่แสดงโฆษณาแบนเนอร์ที่มีความกว้างเท่ากับหน้าจอบนหน้าจอทุกขนาดในอุปกรณ์ต่างๆ ไม่ว่าจะวางแนวใด แบนเนอร์อัจฉริยะจะตรวจหา
ความกว้างของอุปกรณ์ในการวางแนวปัจจุบันและสร้างมุมมองโฆษณาที่มีขนาดดังกล่าว
แบนเนอร์อัจฉริยะบน iPhone มีความสูง 50 จุดในแนวตั้งและ 32 จุดในแนวนอน
บน iPad ความสูงคือ 90 จุดทั้งในแนวตั้งและแนวนอน
เมื่อโฆษณาแบบรูปภาพมีขนาดไม่ใหญ่พอที่จะใช้พื้นที่ที่จัดสรรไว้ทั้งหมด
รูปภาพจะอยู่ตรงกลางและพื้นที่ทั้ง 2 ด้านจะได้รับการเติมเต็ม

หากต้องการใช้แบนเนอร์อัจฉริยะ เพียงระบุ kGADAdSizeSmartBannerPortrait
(สำหรับการวางแนวตั้ง) หรือ kGADAdSizeSmartBannerLandscape
(สำหรับการวางแนวนอน) สำหรับขนาดโฆษณา ดังนี้
Swift
let bannerView = GAMBannerView(adSize: kGADAdSizeSmartBannerPortrait)
Objective-C
GAMBannerView *bannerView = [[GAMBannerView alloc]
initWithAdSize:kGADAdSizeSmartBannerPortrait];
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-23 UTC
[null,null,["อัปเดตล่าสุด 2025-08-23 UTC"],[[["\u003cp\u003eSmart Banners automatically adjust to screen width on different devices and orientations, with fixed heights of 50/32 points on iPhones (portrait/landscape) and 90 points on iPads.\u003c/p\u003e\n"],["\u003cp\u003eThey display screen-width banner ads, centering smaller image ads and filling the surrounding space.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can implement Smart Banners using \u003ccode\u003ekGADAdSizeSmartBannerPortrait\u003c/code\u003e for portrait or \u003ccode\u003ekGADAdSizeSmartBannerLandscape\u003c/code\u003e for landscape orientation.\u003c/p\u003e\n"],["\u003cp\u003eIt is recommended to use adaptive banners instead of Smart Banners for better functionality.\u003c/p\u003e\n"]]],["Smart Banners display screen-width ads, adapting to any device size and orientation. They automatically detect device width and create appropriately sized ad views. On iPhones, banner heights are 50 points in portrait and 32 in landscape; on iPads, they are 90 points in both. Smaller image ads are centered, with surrounding space filled in. To implement, set the ad size to `kGADAdSizeSmartBannerPortrait` or `kGADAdSizeSmartBannerLandscape`. The newer adaptive banners are an alternative.\n"],null,["| Try the newer [adaptive banners](/ad-manager/mobile-ads-sdk/ios/banner/anchored-adaptive) instead.\n\nSmart Banners are ad units that render screen-width banner ads on any screen\nsize across different devices in either orientation. Smart Banners detect the\nwidth of the device in its current orientation and create the ad view that size.\n\nSmart Banners on iPhones have a height of 50 points in portrait and 32 points in\nlandscape. On iPads, height is 90 points in both portrait and landscape.\n\nWhen an image ad isn't large enough to take up the entire allotted space, the\nimage will be centered, and the space on either side will be filled in.\n\nTo use Smart Banners, just specify `kGADAdSizeSmartBannerPortrait`\n(for portait orientation) or `kGADAdSizeSmartBannerLandscape` (for landscape\norientation) for the ad size: \n\nSwift \n\n```swift\nlet bannerView = GAMBannerView(adSize: kGADAdSizeSmartBannerPortrait)\n```\n\nObjective-C \n\n```objective-c\nGAMBannerView *bannerView = [[GAMBannerView alloc]\n initWithAdSize:kGADAdSizeSmartBannerPortrait];\n```"]]