Change properties for iAd view created using canDisplayBannerAds

194 views Asked by At

On iOS 8 the iAd banner automatically created by using canDisplayBannerAd is displayed with a white background: that does not suit the app design at all. So I need to change it.

How to do it ? Changing the background color property is easy but how to access the iAd banner view?

On iOS7 it was fine.

1

There are 1 answers

0
Dominique Vial On

Ok, I found a way by creating a category for ADBannerView and modifying background color property in it.

The modification is made in willMoveToWindow:(UIWindow *)newWindow.

-(void) willMoveToWindow:(UIWindow *)newWindow {

    [super willMoveToWindow:newWindow];
    self.backgroundColor = [UIColor blackColor];
}