1

横幅广告非常适合 4s、5 和 5s 的屏幕底部,但对于 iPad 和 iPhone 6 和 6+ 来说太小了。我究竟做错了什么?我把这段代码放在 GameViewController.swift 文件中。如果您需要更多信息,请告诉我。谢谢!

let adView: FBAdView = FBAdView(placementID:"PLACEMENT_ID",   
adSize:kFBAdSize320x50, rootViewController:self)
adView.frame = CGRect(x: 0, y: self.view.frame.size.height - 50, width: 320, height: 90)
    self.view.addSubview(adView)
    adView.delegate = self
    FBAdSettings.addTestDevice("TESTDEVICE")
    adView.loadAd()
4

1 回答 1

2

您应该使用百分比大小:

var theWidth = self.frame.width
var theHeight = self.frame.height / 15 //for example. But make the height as you need

而不是像您那样硬编码大小。然后你可以像这样使用你的尺寸:

adView.frame = CGRect(x: 0, y: self.view.frame.size.height - 50, width: theWidth, height: theHeight)
于 2015-05-20T17:27:09.447 回答