简体   繁体   English

Objective-C,滚动视图上的广告

[英]Objective-C, Ads on a scrollview

I'm currently using AdWhirl for my iOS app.我目前正在为我的 iOS 应用程序使用 AdWhirl。 I want to have my ads in the bottom of a scrollview.我想让我的广告出现在滚动视图的底部。 How can I achive that without Interface Builder, or can I use Interface builder?如果没有 Interface Builder,我该如何实现,或者我可以使用 Interface builder?

An initial look suggests that its simply a subclass of UIView.最初的外观表明它只是 UIView 的子类。 You can get the bounds of your UIScrollView add an instance of the AdWhirl view as a subview to the ScrollView and extend the content area.您可以获得 UIScrollView 的边界,将 AdWhirl 视图的实例作为子视图添加到 ScrollView 并扩展内容区域。

Like any other view really.就像任何其他观点一样。

no need to use interface builder for that.无需为此使用界面生成器。

what you have to do is:- you must be adding below lines in your viewDidLoad:-您要做的是:- 您必须在 viewDidLoad 中添加以下行:-

AdWhirlView *awView = [AdWhirlView requestAdWhirlViewWithDelegate:self]; 
[self.view addSubview:awView];

You need to change [self.view addSubview:awView];你需要改变[self.view addSubview:awView]; line to线到

[self.*yourscrollviewname* addSubview:awView];

then ads will be added in your scrollview.然后广告将添加到您的滚动视图中。

for repositioning them in AdWhirlView.h file find below lines and set the coordinates according to your requirement.为了在 AdWhirlView.h 文件中重新定位它们,请找到以下行并根据您的要求设置坐标。

#define kAdWhirlViewDefaultFrame \
                        (CGRectMake(0,50,kAdWhirlViewWidth, kAdWhirlViewHeight))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM