此代码将iAd横幅定位在屏幕顶部。如何定位它以使其位于屏幕底部?
override func didMoveToView(view: SKView) {
bannerView = ADBannerView(adType: .Banner)
bannerView.translatesAutoresizingMaskIntoConstraints = false
bannerView.delegate = self
bannerView.hidden = true
view.addSubview(bannerView)
let viewsDictionary = ["bannerView": bannerView]
view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:[bannerView]", options: [], metrics: nil, views: viewsDictionary))
view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:[bannerView]", options: [], metrics: nil, views: viewsDictionary))
}
答案 0 :(得分:-1)
Normaly这些代码行足以显示底部横幅广告:
colname
Apple关注其余部分。如果您对简短教程感兴趣:Quick Tip: Integrate iAd banners in your iOS App with two lines of code