问题
Whenever I set
self.canDisplayBannerAds = true
in my viewDidLoad method, my layouts all get shifted over and messed up for some reason. The webview has been zoomed in by a few pixels and the status bar is shifted down.
but when I remove that line of code, my ad displays just fine and everything is perfect.
回答1:
If you're implementing your own ADBannerView then you need to remove self.canDisplayBannerAds = true from your viewDidLoad.
self.canDisplayBannerAds = true can be used for a no hassle way of implementing iAd banners in your application. This will create an ADBannerView for you and show or hide the ADBannerView depending on whether it receives an ad or not from the iAd network.
You either implement your own ADBannerView or use self.canDisplayBannerAds = true, not both.
来源:https://stackoverflow.com/questions/32420273/iads-causes-problems-with-auto-layout