使用带有情节提要的 XCode 4 为基于 UITabBarController 的应用程序共享 iAd 横幅 [英] Shared iAd banner for UITabBarController based app using XCode 4 with storyboard
问题描述
1:下载 Xcode 4.2 的示例项目
1: Download sample project for Xcode 4.2
2:使横幅在每个视图的标签栏上方可见
2: Make the banner visible above the Tab Bar from every view
3:发布答案
4:获得赏金
5:让别人开心,我会辅导的.此重要步骤 atm 没有现有教程.
5: make other people happy, I will tutorialize it. No place existing tutorial for this important step atm.
推荐答案
其实很简单.只需为每个选项卡创建一个新的横幅视图控制器,它将成为情节提要中每个选项卡的父视图控制器.然后将 Container View 对象拖入每个横幅视图控制器,并将您的子视图控制器嵌入到每个横幅视图控制器中.
It's fairly simple actually. Just create a new banner view controller for each tab that will be the parent view controller for each tab in your storyboard. Then drag in a Container View object into each banner view controller and embed your child view controllers in each banner view controller.
最后在 BannerViewController.m 中替换自定义 init 方法一个方法来覆盖 initWithCoder:
您将在其中将横幅视图控制器添加到横幅管理器.还可以实现 prepareForSegue:
,您可以在其中将 _contentController
设置为 segue 的目标视图控制器.
Finally in BannerViewController.m replace the custom init method a method to override initWithCoder:
where you will add the banner view controller to the banner manager. Also implement prepareForSegue:
where you can set the _contentController
to the segue's destination view controller.
我的 博文更详细地介绍了一个示例项目.
My blog post goes into a lot more detail and links to an example project.
这篇关于使用带有情节提要的 XCode 4 为基于 UITabBarController 的应用程序共享 iAd 横幅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!