我无法让kGADAdSizeSmartBannerPortrait起作用。
期望结果: 在iPhone 6 Plus上,横幅的宽度应为414点。 在iPhone 6上,横幅的宽度应为375点。 在其他iPhone和iPod上,横幅应为320点。
实际结果: 我在所有设备上都看到"320x50测试横幅"。在宽屏设备上,320x50横幅位于视图中心。左右两侧的剩余空间具有灰色图案。
实际使用的代码:
期望结果: 在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 屏幕截图: