不解

加广告(iOS)

ADBannerView 广告栏视图Description 描述

AD Banner View is a wrapper around the ADBannerView class found in the Apple iAd framework and is only available on iOS.
广告栏视图 是关于苹果的iAd框架中的ADBannerView类的包装,并只适用于iOS。

It provides a view that displays banner advertisements to the user.
它提供了一个显示广告栏给用户的视图。

JavaScript:

var banner : ADBannerView = null; function Start() { banner = new ADBannerView(ADBannerView.Type.Banner, ADBannerView.Layout.Top); ADBannerView.onBannerWasClicked += OnBannerClicked; ADBannerView.onBannerWasLoaded += OnBannerLoaded; } function OnBannerClicked() { Debug.Log("Clicked!\n"); } function OnBannerLoaded() { Debug.Log("Loaded!\n"); banner.visible = true; }

C#:

private ADBannerView banner = null; void Start() { banner = new ADBannerView(ADBannerView.Type.Banner, ADBannerView.Layout.Top); ADBannerView.onBannerWasClicked += OnBannerClicked; ADBannerView.onBannerWasLoaded += OnBannerLoaded; } void OnBannerClicked() { Debug.Log("Clicked!\n"); } void OnBannerLoaded() { Debug.Log("Loaded!\n"); banner.visible = true; } Variables 变量

layoutBanner layout 广告栏布局loadedChecks if banner contents are loaded. 检查广告内容是否加载完毕positionThe position of the banner view.广告栏的位置sizeThe size of the banner view. 广告栏的大小visibleBanner visibility. Initially banner is not visible. 广告栏的可见度,默认是不可见的

Constructors 构造函数

ADBannerViewCreates a banner view with given type and auto-layout params. 创建一个广告栏视图 根据类型和布局参数。

Static Functions 静态函数

IsAvailableChecks if the banner type is available (e.g. MediumRect is available only starting with ios6). 检查广告栏是否可用(例如MediumRect仅支持iOS6以后的版本)。

评论