Bob Williams Bob Williams - 2 months ago 25
Swift Question

Position GADBannerView on bottom of screen

My

GADBannerView
is currently at the top, how can I change its position to the bottom?

var Banner = GADBannerView(adSize: kGADAdSizeSmartBannerPortrait)
var request:GADRequest = GADRequest()

override func viewDidLoad() {
super.viewDidLoad()
func showBanner() {
Banner.hidden = false
Banner.adUnitID = "ca-app-pub-**************"
Banner.rootViewController = self
Banner.delegate = self
self.view.addSubview(Banner)
Banner.loadRequest(request)
request.testDevices = [kGADSimulatorID];
}
}


What should I add?

Answer
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)