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)
Creates a new AdSize .

Public types

enum
The type of banner ad.

Public static attributes

Banner = new AdSize(320, 50)
readonly AdSize
Interactive Advertising Bureau (IAB) banner ad size (320x50 density-independent pixels).
FullWidth = -1
readonly int
The full width banner size.
IABBanner = new AdSize(468, 60)
readonly AdSize
Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels).
Leaderboard = new AdSize(728, 90)
readonly AdSize
Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels).
MediumRectangle = new AdSize(300, 250)
readonly AdSize
Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels).
SmartBanner = new AdSize(0, 0, Type.SmartBanner)
readonly AdSize
A dynamically sized banner that is full-width and auto-height.

Properties

The type of banner ad.
int
The height of the ad in density-independent pixels.
int
The width of the ad in density-independent pixels.

Public functions

Equals (object obj)
override bool
Returns whether the AdSize objects are equal.
override int
Returns the hash code.

Public static functions

Gets a current orientation adaptive banner ad size.
Gets a landscape adaptive banner ad size.
Gets a portrait adaptive banner ad size.
bool
Returns whether the AdSize objects are not equal.
bool
Returns whether the AdSize objects are equal.

Public types

Type

  
 Type 

The type of banner ad.

Public static attributes

 readonly 
  
  AdSize 
 
  
 Banner 
  
 = 
  
 new 
  
 AdSize 
 ( 
 320 
 , 
  
 50 
 ) 

Interactive Advertising Bureau (IAB) banner ad size (320x50 density-independent pixels).

FullWidth

 readonly 
  
 int 
  
 FullWidth 
  
 = 
  
 - 
 1 

The full width banner size.

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

AdType

  Type 
 
  
 AdType 

The type of banner ad.

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 .

Details
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 
 ) 

Returns whether the AdSize objects are equal.

GetHashCode

 override 
  
 int 
  
 GetHashCode 
 () 

Returns the hash code.

Public static functions

GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth

  AdSize 
 
  
 GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth 
 ( 
  
 int 
  
 width 
 ) 

Gets a current orientation adaptive banner ad size.

Details
Parameters
width
The width of the ad in density-independent pixels.
Returns
A current orientation adaptive banner ad size.

GetLandscapeAnchoredAdaptiveBannerAdSizeWithWidth

  AdSize 
 
  
 GetLandscapeAnchoredAdaptiveBannerAdSizeWithWidth 
 ( 
  
 int 
  
 width 
 ) 

Gets a landscape adaptive banner ad size.

Details
Parameters
width
The width of the ad in density-independent pixels.
Returns
A landscape adaptive banner ad size.

GetPortraitAnchoredAdaptiveBannerAdSizeWithWidth

  AdSize 
 
  
 GetPortraitAnchoredAdaptiveBannerAdSizeWithWidth 
 ( 
  
 int 
  
 width 
 ) 

Gets a portrait adaptive banner ad size.

Details
Parameters
width
The width of the ad in density-independent pixels.
Returns
A portrait adaptive banner ad size.

operator!=

 bool 
  
 operator 
 != 
 ( 
  
  AdSize 
 
  
 a 
 , 
  
  AdSize 
 
  
 b 
 ) 

Returns whether the AdSize objects are not equal.

Details
Parameters
a
The first AdSize object.
b
The second AdSize object.
Returns
True if the AdSize objects are not equal.

operator==

 bool 
  
 operator 
 == 
 ( 
  
  AdSize 
 
  
 a 
 , 
  
  AdSize 
 
  
 b 
 ) 

Returns whether the AdSize objects are equal.

Details
Parameters
a
The first AdSize object.
b
The second AdSize object.
Returns
True if the AdSize objects are equal.

Create a Mobile Website
View Site in Mobile | Classic
Share by: