Technical Q&A QA1641

Hiding iAd banners when ads are not available

Q:  When and how should I hide iAd banners?

A: When and how should I hide iAd banners?

You should hide your banner view whenever ad content is not available; this includes:

You can hide the banner view by following the steps below.

First, check if your banner view has already downloaded an ad from ADBannerView's bannerLoaded property. If it has not, you can proceed to hide the banner.

To hide the banner view, you should:

Specifically, if your banner is at the bottom of the screen, you should move the frame of the banner view down by the height of the banner; if your banner is at the top of the screen, you should move the frame of the banner view up by the height of the banner.

For a code example, see Sample Code "iAdSuite". For more information on the banner view lifecycle, see theiAd Programming Guide.



Document Revision History


DateNotes
2010-09-14

Updated for iOS 4.1. Move the frame instead of the center of the banner.

2010-08-19

New document that describes how to hide an iAd banner views when ads are not available.