iAds会导致自动布局出现问题? [英] iAds causes problems with auto layout?

查看:47
本文介绍了iAds会导致自动布局出现问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我设置

self.canDisplayBannerAds = true

在我的viewDidLoad方法中,由于某种原因,我的所有布局都被移开并弄乱了.网络视图已放大了几个像素,状态栏向下移动了.

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.

但是当我删除该行代码时,我的广告显示得很好,并且一切都完美.

推荐答案

如果要实现自己的ADBannerView,则需要从viewDidLoad中删除self.canDisplayBannerAds = true.

If you're implementing your own ADBannerView then you need to remove self.canDisplayBannerAds = true from your viewDidLoad.

self.canDisplayBannerAds = true可用于轻松在应用程序中实施iAd标语的方式.这样会为您创建一个ADBannerView,并根据其是否从iAd网络接收广告来显示或隐藏ADBannerView.

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.

您要么实现自己的ADBannerView,要么使用self.canDisplayBannerAds = true,而不是同时使用两者.

You either implement your own ADBannerView or use self.canDisplayBannerAds = true, not both.

这篇关于iAds会导致自动布局出现问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆