iAd`UIViewController`类`canDisplayBannerAds`有什么作用? [英] What does the iAd `UIViewController` category `canDisplayBannerAds` do?

查看:109
本文介绍了iAd`UIViewController`类`canDisplayBannerAds`有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS7中,iAds框架包含类别 - [UIViewController canDisplayBannerAds]

In iOS7, the iAds framework includes the category -[UIViewController canDisplayBannerAds].

此类别是什么我应该如何使用它?

What does this category do and how should I use it?

推荐答案

的标题canDisplayBannerAds 州:


设置此项以使用
视图控制器启用横幅广告显示的自动管理。
重要的是要注意,这将通过在视图控制器视图上方插入新的容器视图来修改视图控制器
的视图层次结构。
的影响是视图控制器的view属性将不再返回原来的
提供的视图,它将返回新的容器。要访问原始视图,
使用originalContentView属性。

Set this to enable automatic management of banner ad display with the view controller. It's important to note that this will modify the view hierarchy of the view controller by inserting a new container view above the view controller's view. The impact is that the view controller's view property will no longer return the originally provided view, it will return the new container. To access the original view, use the originalContentView property.

不清楚的是自动管理还指在视图层次结构中实例化并插入 ADBannerView 您不需要实例化 ADBannerView ,也不需要ADBannerView属性或实例变量。

What is not clear is that automatic management also refers to instantiating and inserting an ADBannerView into your view hierarchy. You do not need to instantiate an ADBannerView, and you do not need an ADBannerView property or instance variable.

您仍然希望在视图控制器中遵循 ADBannerViewDelegate 协议,以便在用户点击广告时暂停您的应用,并且然后在全屏广告消失时恢复。

You will still want to adhere to the ADBannerViewDelegate protocol in your view controller so you can pause your application when the user taps the ad, and then resume when the fullscreen ad goes away.

更新:除非您想要浏览视图层次结构以查找自动广告插入 ADBannerView 将视图控制器设置为委托,您还可以剪切 ADBannerViewDelegate 协议方法。

Update: Unless you want to walk through the view hierarchy looking for the automatically inserted ADBannerView to set your view controller as a delegate, you can also cut the ADBannerViewDelegate protocol methods.

这篇关于iAd`UIViewController`类`canDisplayBannerAds`有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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