Interface Builder 中的 Objective-C、Adwhirl 横幅
有人对如何在界面生成器中制作 AdWhirl 横幅有任何建议吗?现在我使用这段代码来制作一个横幅:
AdWhirlView *awView = [AdWhirlView requestAdWhirlViewWithDelegate:self];
[self.view addSubview:awView];
awView.frame = CGRectMake(0, 361, kAdWhirlViewWidth, kAdWhirlViewHeight);
我尝试制作一个 UIView 并为其制作一个 IBOutlet 并使其成为 AdWhirlView 类,但我似乎无法正确执行...
谢谢
Does anyone have any suggestions on how to make a AdWhirl banner in interface builder? Right now I use this code to make a banner:
AdWhirlView *awView = [AdWhirlView requestAdWhirlViewWithDelegate:self];
[self.view addSubview:awView];
awView.frame = CGRectMake(0, 361, kAdWhirlViewWidth, kAdWhirlViewHeight);
I've tried to make a UIView and making an IBOutlet to it and making it's class a AdWhirlView but I can't seem to get it right...
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是我与 IB 一起使用的代码:
In SecondViewController.h
In SecondViewController.m
然后
使用大小为 320x50 的类 AdWhirlView 将 awView 连接到 IB 中的 UIView
Here is the code that I use with IB:
In SecondViewController.h
In SecondViewController.m
And
Then connecting the awView to a UIView in IB with the class AdWhirlView with the size 320x50
我记得我在一个类似的项目中使用了 ADWhirl。我只是在这里复制代码
然后不要忘记实现这些委托方法。
最后,还实现这些委托方法以便更好地调试。
更新:
我在使用 IB 的视图后收到广告。
但它仅以编程方式获取 adView 的矩形。我的意思是,我将 adView 放在 IB 的中间,但它过去显示在顶部。但是,是的,我收到了广告。
I remember i used ADWhirl in one of my projects something like this. I am just copying the code here
Then don't forget to implement these delegate methods.
Finally, also implement these delegate methods for better debugging.
UPDATE:
I am receiving ads after using the view from IB.
But it takes the adView's rect only programatically. I mean, i put the adView in the IB in the middle, but it used to display at the top. But yeah, i get ad's.