Skip to end of metadata
Go to start of metadata

Control Ad Unit Alignment

This page has instructions on how to control the alignment of banner ads.

On This Page

Android

Use the BannerView.setAdAlignment(enum AdAlignment) method to override the alignment of the ad unit within the banner ad view:

This will only work in cases where the banner ad view's frame is larger than the ad. The default alignment is CENTER. The ad can be aligned in one of the following ways:

  • center
  • top left
  • top center
  • top right
  • center left
  • center right
  • bottom left
  • bottom center
  • bottom right

iOS

Use the ANBannerViewAdAlignment property of banner ad views to override the alignment of the ad unit within the banner ad view:

This will only work in cases where the banner ad view's frame is larger than the ad. The default alignment is ANBannerViewAdAlignmentCenter. The ad can be aligned in one of the following ways:

  • center
  • top left
  • top center
  • top right
  • center left
  • center right
  • bottom left
  • bottom center
  • bottom right

Related Topics

  • No labels