我无法让kGADAdSizeSmartBannerPortrait工作.
预期:在iPhone 6 Plus上,横幅的宽度应为414点.在iPhone 6上,横幅的宽度应为375点.在其他iPhone和iPod上,这一点,横幅将是320点.
实际结果:我在所有设备上看到"320x50测试横幅".在宽屏设备上,320x50横幅在视图中居中.左侧和右侧的剩余空间呈灰色图案.
使用的实际代码:
GADBannerView* newbanner = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait]; NSLog(@"newbanner size: %@", NSStringFromCGSize(newbanner.frame.size)); newbanner.adUnitID = @"/6499/example/banner"; newbanner.rootViewController = self; GADRequest *request = [GADRequest request]; request.testDevices = @[ @"somedeviceid1", @"somedeviceid2", ]; [newbanner loadRequest:request]; [self.view addSubview:newbanner]; newbanner.center = CGPointMake(self.view.frame.size.width * 0.5, self.view.frame.size.height * 0.5);
iPhone 6 Plus截图: