我的GADBannerView设置为50高度和320宽度的约束,并水平居中。 当视图加载时,它会启动我的iOS模拟器的adreqeust,如下所示:
NSLog(@"Google Mobile Ads SDK version: %@", [GADRequest sdkVersion]); GADRequest *request = [GADRequest request]; request.testDevices = @[ kGADSimulatorID ]; self.googleBanner.adUnitID = @"ca-app-pub-xxxxx/xxxxx"; self.googleBanner.rootViewController = self; [self.googleBanner loadRequest:request];广告加载得很好,但为了看到它我必须将其滚动到位。
以下是我的工作区和约束的屏幕截图:
这是模拟器的屏幕截图以及我如何滚动adbanner
编辑:
我在这里找到了解决问题的方法[ AdMob GADBannerView在视图的可见区域之外加载广告
诀窍是取消选中笔尖中的“扩展边缘...在顶部条形图下”。
My GADBannerView is setup with a constraint of 50 height and 320 width and is centered horizontally. When the view loads it starts an adreqeust for my iOS emulator like so:
NSLog(@"Google Mobile Ads SDK version: %@", [GADRequest sdkVersion]); GADRequest *request = [GADRequest request]; request.testDevices = @[ kGADSimulatorID ]; self.googleBanner.adUnitID = @"ca-app-pub-xxxxx/xxxxx"; self.googleBanner.rootViewController = self; [self.googleBanner loadRequest:request];The ad loads just fine but in order to see it I have to scroll it into position.
Here is a screenshot of my workspace and constraints:
Here is a screenshot of the emulator and how I have to scroll the adbanner
edit:
I found a solution to my problem here [AdMob GADBannerView loads advertisement outside of view's visible area
The trick was to uncheck "Extended Edges ... Under Top Bars" in the nib.
最满意答案
我在这里找到了解决问题的方法[ AdMob GADBannerView在视图的可见区域之外加载广告
诀窍是取消选中笔尖中的“扩展边缘...在顶部条形图下”。
I found a solution to my problem here [AdMob GADBannerView loads advertisement outside of view's visible area
The trick was to uncheck "Extended Edges ... Under Top Bars" in the nib.
更多推荐
发布评论