当我在ios中设置admob时,它不会出现广告
这是我的代码
class MainVC: UIViewController,UIScrollViewDelegate, UISearchBarDelegate , UITextFieldDelegate{
let myBanner : DFPBannerView = DFPBannerView()
override func viewDidLoad() {
super.viewDidLoad()
let request = GADRequest()
request.testDevices = [kGADSimulatorID]
//myBanner.delegate = self
myBanner.rootViewController = self
myBanner.adUnitID = "ca-app-pub-7025295311419616/6321740358"
myBanner.load(request)
}
func admob() {
myBanner.frame = CGRect(x: (CGFloat(index) * (scrollview.frame.width * 0.6 + (scrollView_main.frame.width * 0.10)) + (scrollView_main.frame.width * 0.05)), y: 0 , width: scrollview.bounds.width * 0.6, height: scrollview.bounds.height * 0.8)
scrollview.addSubview(myBanner)
myBanner.contentMode = .scaleAspectFit
myBanner.frame.origin.x = (CGFloat(num) * (myBanner.frame.size.width + (scrollView_main.frame.width * 0.10)) + (scrollView_main.frame.width * 0.05))
myBanner.frame.origin.y = 0
}
}
当我构建时出现此错误
UIViewAlertForUnsatisfiableConstraints在调试器中捕获它。 UIView中的UIConstraintBasedLayoutDebugging类中的方法 列出也可能有所帮助。 2018年5月5日 19:45:15.004280 + 0900食物[11788:202741] WF:===启动WebFilter 记录过程Food2018-05-05 19:45:15.005328 + 0900 SUFOO [11788:202741] WF:_userSettingsForUser:(null)2018-05-05 19:45:15.006396 + 0900食物[11788:202741] WF:_WebFilterIsActive 返回:NO 2018-05-05 19:45:18.161588 + 0900食物[11788:202741] WF: _userSettingsForUser:(null)2018-05-05 19:45:18.162901 + 0900食物[11788:202741] WF:_WebFilterIsActive返回:否
我需要你的回答谢谢。