ADBannerNavigation 弹出视图控制器时广告应在的空白区域
我下载了 iAdSuite 并查看了 ADBannerNavigation。
在内部,我将 RootViewController 更改为 TextViewController 的子类,以便利用 iAd 横幅调整大小的优势。我也想在 RootView 上显示广告。
现在是 RootViewController.h:
#import <UIKit/UIKit.h>
#import "TextViewController.h"
@interface RootViewController : TextViewController
@end
其他一切都一样。当我编译并运行时,RootView中没有广告出现,当我点击TextView时,广告突然出现。
当我单击返回时,RootView 中现在有空白区域。
为什么? 如何删除空白区域?
I downloaded iAdSuite and looked into ADBannerNavigation.
Inside, I changed the RootViewController to subclass TextViewController in order to take advantage of the iAd banner resizing. I want to display ads on the RootView as well.
This is now RootViewController.h:
#import <UIKit/UIKit.h>
#import "TextViewController.h"
@interface RootViewController : TextViewController
@end
Everything else is the same. When I compile and run, no ads show up in RootView, and when I click into TextView, ads suddenly show up.
When I click to go back, there is now white space in RootView.
WHY?
How do you remove the white space?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发现我删除 ADBannerView 的方式存在错误。
iAd Suite 告诉我们:
因此,在我的 iADBannerView.m 中,我有:
通过设置断点,我看到通过退出视图,在 view1 上调用 viewWillDisappear,然后在 view0 上调用 viewWillAppear,然后在 view1 上调用 dealloc。
问题是 view1 已经从视图中删除了 ADBannerView,因此 [adBanner removeFromSuperView] 正在从 view0 中删除广告。
通过从 dealloc 方法中删除有问题的代码解决了问题。
Found the error in how I was removing the ADBannerView.
iAd Suite tells us to:
So, in my iADBannerView.m, I have:
By setting breakpoints, I saw that by exiting a view, viewWillDisappear was being called on view1, then viewWillAppear on view0 and then dealloc on view1.
The problem was that view1 already removed the ADBannerView from the view, so [adBanner removeFromSuperView] was removing the Ad from view0.
Problem solved by removing offending code from the dealloc method.