gpt4 book ai didi

iphone - 如何在 iOS 视网膜和非视网膜屏幕底部放置 admob 横幅

转载 作者:可可西里 更新时间:2023-11-01 03:40:05 24 4
gpt4 key购买 nike

我构建了一个 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]];

最佳答案

你可以试试这个,

bannerView_ = [[GADBannerView alloc] initWithFrame:CGRectMake(0.0, self.view.frame.size.height-GAD_SIZE_320x50.height, GAD_SIZE_320x50.width, GAD_SIZE_320x50.height)];

关于iphone - 如何在 iOS 视网膜和非视网膜屏幕底部放置 admob 横幅,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14564033/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com