Stay organized with collections
Save and categorize content based on your preferences.
GoogleMobileAds.
Api.
BannerView
Banner views occupy a spot within an app's layout.
Summary
They stay on screen while users are interacting with the app.
Inheritance
Direct Known Subclasses: GoogleMobileAds.Api.AdManager.AdManagerBannerView
Constructors and Destructors
BannerView
(string adUnitId, AdSize
adSize, int x, int y)
Creates a banner view with a custom position.
Action
Raised when an ad is clicked.
Action
Raised when the ad closed full-screen content.
Action
Raised when an ad opened full-screen content.
Action
Raised when an impression is recorded for an ad.
Raised when the ad is estimated to have earned money.
Raised when an ad fails to load into the banner view.
Action
Raised when an ad is loaded into the banner view.
void
Destroys the banner view.
string
Returns the ad unit ID.
float
Returns the height of the banner view in pixels.
Returns the ad request response info or null if the ad is not loaded.
float
Returns the width of the banner view in pixels.
void
Hides the banner view.
bool
Indicates whether the last loaded ad is a collapsible banner.
void
Loads an ad into the banner view.
void
Sets the position of the banner view using standard position.
void
Sets the position of the banner view using custom position.
void
Shows the banner view.
Events
OnAdClicked
Action
OnAdClicked
Raised when an ad is clicked.
OnAdFullScreenContentClosed
Action
OnAdFullScreenContentClosed
Raised when the ad closed full-screen content.
On iOS, this event is only raised when an ad opens an overlay, not when opening a new application such as Safari or the App Store.
OnAdFullScreenContentOpened
Action
OnAdFullScreenContentOpened
Raised when an ad opened full-screen content.
OnAdImpressionRecorded
Action
OnAdImpressionRecorded
Raised when an impression is recorded for an ad.
OnAdPaid
Action
<
AdValue
>
OnAdPaid
Raised when the ad is estimated to have earned money.
OnBannerAdLoadFailed
Action
<
LoadAdError
>
OnBannerAdLoadFailed
Raised when an ad fails to load into the banner view.
OnBannerAdLoaded
Action
OnBannerAdLoaded
Raised when an ad is loaded into the banner view.
Properties
IsDestroyed
bool
IsDestroyed
Public functions
BannerView
BannerView
(
string
adUnitId
,
AdSize
adSize
,
AdPosition
position
)
Creates a banner view with a standard position.
BannerView
BannerView
(
string
adUnitId
,
AdSize
adSize
,
int
x
,
int
y
)
Creates a banner view with a custom position.
Destroy
void
Destroy
()
Destroys the banner view.
GetAdUnitID
string
GetAdUnitID
()
GetHeightInPixels
float
GetHeightInPixels
()
Returns the height of the banner view in pixels.
GetResponseInfo
ResponseInfo
GetResponseInfo
()
Returns the ad request response info or null if the ad is not loaded.
GetWidthInPixels
float
GetWidthInPixels
()
Returns the width of the banner view in pixels.
IsCollapsible
bool
IsCollapsible
()
Indicates whether the last loaded ad is a collapsible banner.
LoadAd
void
LoadAd
(
AdRequest
request
)
Loads an ad into the banner view.
SetPosition
void
SetPosition
(
AdPosition
adPosition
)
Sets the position of the banner view using standard position.
SetPosition
void
SetPosition
(
int
x
,
int
y
)
Sets the position of the banner view using custom position.
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\u003eBannerView\u003c/code\u003e objects display ads within an app's layout, remaining on screen during user interaction.\u003c/p\u003e\n"],["\u003cp\u003eThey can be positioned using standard or custom coordinates and offer events for ad interactions like clicks, impressions, and load failures.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can control banner visibility with \u003ccode\u003eShow()\u003c/code\u003e and \u003ccode\u003eHide()\u003c/code\u003e functions, and \u003ccode\u003eDestroy()\u003c/code\u003e to release resources.\u003c/p\u003e\n"],["\u003cp\u003eProperties like \u003ccode\u003eIsDestroyed\u003c/code\u003e, \u003ccode\u003eGetHeightInPixels\u003c/code\u003e, and \u003ccode\u003eGetWidthInPixels\u003c/code\u003e provide information about the banner's state and dimensions.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eLoadAd()\u003c/code\u003e is used to request and display an ad in the banner view, while \u003ccode\u003eGetResponseInfo()\u003c/code\u003e provides ad request details.\u003c/p\u003e\n"]]],["Banner views display ads within an app's layout. Key actions include creating a `BannerView` with either a standard or custom position using an ad unit ID and `AdSize`. Ads are loaded via `LoadAd` and can be shown or hidden using `Show` and `Hide`. `SetPosition` allows repositioning, and `Destroy` removes the view. Events are triggered when ads are clicked, load, fail to load, open/close full-screen content, or register an impression. Ad properties, like width and height, can also be retrieved.\n"],null,[]]