iOS 7不支持admob?

时间:2013-09-27 04:07:48

标签: admob ios7

这是我的代码:

gAdView=[[GADBannerView alloc] initWithFrame:CGRectMake(0,self.view.bounds.size.height-GAD_SIZE_320x50.height,GAD_SIZE_320x50.width,GAD_SIZE_320x50.height)];
gAdView.adUnitID = admobID;
gAdView.rootViewController=self;
gAdView.delegate = self;
[self.view addSubview:gAdView];
[gAdView loadRequest:[self createRequest]];

在iOS 5和iOS中它非常好用iOS 6,但在iOS 7中没有显示? 为什么? ADMOB LIB:6.5.1

1 个答案:

答案 0 :(得分:0)

以下代码适用于iOS 7,

bannerView_      = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];   
bannerView_.adUnitID           = @"your-mediation-id";
bannerView_.rootViewController = self;
bannerView_.frame = CGRectMake(0,518,320,50);
[self.view addSubview:bannerView_];
[bannerView_ loadRequest:[GADRequest request]];

你为什么要设置代表?