gpt4 book ai didi

ios - 将 GADBannerView 置于屏幕底部

转载 作者:搜寻专家 更新时间:2023-11-01 06:37:45 25 4
gpt4 key购买 nike

我的 GADBannerView 目前在顶部,如何将其位置更改为底部?

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];
}
}

我应该添加什么?

最佳答案

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)

关于ios - 将 GADBannerView 置于屏幕底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39472014/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com