我已经构建了一个 phonegap 应用程序,并想向它添加一个 Admob 横幅。我的横幅在 iOS6 模拟器的屏幕底部工作,但是当我在视网膜设备上对其进行测试时,横幅将远离底部,就像它仍在尝试为非视网膜显示调整屏幕大小一样。这是我当前在 viewDidLoad 中的代码:
// Initialize the banner at the bottom of the screen.
CGPoint origin = CGPointMake(0.0,
self.view.frame.size.height -
CGSizeFromGADAdSize(kGADAdSizeBanner).height);
// Use predefined GADAdSize constants to define the GADBannerView.
bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner
origin:origin];
// Specify the ad's "unit identifier." This is your AdMob Publisher ID.
bannerView_.adUnitID = @"xxxxxxxxxxxx";
// Let the runtime know which UIViewController to restore after taking
// the user wherever the ad goes and add it to the view hierarchy.
bannerView_.rootViewController = self;
[self.view addSubview:bannerView_];
// Initiate a generic request to load it with an ad.
[bannerView_ loadRequest:[GADRequest request]];