Stay organized with collections
Save and categorize content based on your preferences.
GoogleMobileAds.
Api.
AdSize
The size of a banner ad.
Summary
See also:https://developers.google.com/admob/unity/banner::banner_sizes
Banner sizes.
Constructors and Destructors
AdSize
(int width, int height)
enum The type of banner ad.
Interactive Advertising Bureau (IAB) banner ad size (320x50 density-independent pixels).
Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels).
Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels).
Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels).
A dynamically sized banner that is full-width and auto-height.
int
The height of the ad in density-independent pixels.
int
The width of the ad in density-independent pixels.
Public types
Public static attributes
Banner
readonly
AdSize
Banner
=
new
AdSize
(
320
,
50
)
Interactive Advertising Bureau (IAB) banner ad size (320x50 density-independent pixels).
FullWidth
readonly
int
FullWidth
=
-
1
IABBanner
readonly
AdSize
IABBanner
=
new
AdSize
(
468
,
60
)
Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels).
Leaderboard
readonly
AdSize
Leaderboard
=
new
AdSize
(
728
,
90
)
Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels).
MediumRectangle
readonly
AdSize
MediumRectangle
=
new
AdSize
(
300
,
250
)
Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels).
SmartBanner
readonly
AdSize
SmartBanner
=
new
AdSize
(
0
,
0
,
Type
.
SmartBanner
)
A dynamically sized banner that is full-width and auto-height.
Properties
Height
int
Height
The height of the ad in density-independent pixels.
Width
int
Width
The width of the ad in density-independent pixels.
Public functions
AdSize
AdSize
(
int
width
,
int
height
)
Creates a new AdSize
.
Parameters
width
|
The width of the ad in density-independent pixels.
|
height
|
The height of the ad in density-independent pixels.
|
Equals
override
bool
Equals
(
object
obj
)
GetHashCode
override
int
GetHashCode
()
Public static functions
GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth
AdSize
GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth
(
int
width
)
GetLandscapeAnchoredAdaptiveBannerAdSizeWithWidth
AdSize
GetLandscapeAnchoredAdaptiveBannerAdSizeWithWidth
(
int
width
)
GetPortraitAnchoredAdaptiveBannerAdSizeWithWidth
AdSize
GetPortraitAnchoredAdaptiveBannerAdSizeWithWidth
(
int
width
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003eGoogleMobileAds.Api.AdSize\u003c/code\u003e defines the size of a banner ad, including standard IAB sizes and Smart Banners.\u003c/p\u003e\n"],["\u003cp\u003eIt provides properties to access the width, height, and type of the ad.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can create custom \u003ccode\u003eAdSize\u003c/code\u003e instances using width and height values.\u003c/p\u003e\n"],["\u003cp\u003eStatic methods allow retrieving adaptive banner sizes based on orientation and width.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAdSize\u003c/code\u003e class is essential for configuring the display dimensions of banner ads in your application.\u003c/p\u003e\n"]]],["`AdSize` defines banner ad dimensions for Google Mobile Ads. Key actions include creating an `AdSize` using `width` and `height` or using predefined static sizes like `Banner` (320x50), `IABBanner` (468x60), `Leaderboard` (728x90), `MediumRectangle` (300x250), and `SmartBanner` (full-width, auto-height). It provides functions to get adaptive banner sizes based on orientation and width. Also can obtain ad properties like `AdType`, `Height`, and `Width`. Finally it can check if two AdSize are equal.\n"],null,[]]