Reputation: 21
Hi there I'm trying to change the position of my AdMob banner in one of my scenes. The ad displays successfully (and is hidden successfully) whenever I set it to be, but it doesn't take the position I give it. It's always on the top. How can I set it to position at the bottom of the screen?
banner.frame = CGRect(x:0.0,
y:-(self.view?.frame.size.height)! + banner.frame.size.height,
width:banner.frame.size.width,
height:banner.frame.size.height)
banner = GADBannerView(adSize: kGADAdSizeSmartBannerPortrait)
banner.adUnitID = "ca-app-pub-xxxx"
banner.rootViewController = gameViewController
let request: GADRequest = GADRequest()
request.testDevices = ["xxxx"]
banner.load(request)
self.view?.addSubview(banner)
Upvotes: 0
Views: 297
Reputation:
You are initialising a new banner after setting the frame, switch lines 1 and 2 around.
Upvotes: 1