iphone - 将 AdWhirl View 添加到 tabBarController

标签 iphone ios adwhirl tabbarcontroller

我正在尝试将 Adwhirl View 添加到我当前的 iOS 应用程序的顶部。该应用程序由五个不同的 View 组成,它们都在单个 TabBarController 的控制下。任何人都可以编写一个简短的教程来显示实现此目标所需的代码吗?我浏览并尝试了很多解决方案,但没有一个能奏效。

下面是我目前对这个问题的尝试,我没有收到错误,但我在屏幕上没有看到任何不同之处。提前致谢。

@implementation idoubs2AppDelegate

@synthesize window;
@synthesize tabBarController;
@synthesize contactsViewController;
@synthesize messagesViewController;
@synthesize adwhirlview = adview;

static UIBackgroundTaskIdentifier sBackgroundTask = UIBackgroundTaskInvalid;
static dispatch_block_t sExpirationHandler = nil;

#pragma mark -
#pragma mark Application lifecycle

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 

AdWhirlView *adView = [AdWhirlView requestAdWhirlViewWithDelegate:self];
[self.tabBarController.view addSubview:adView];
adView.center = CGPointMake(160, 342);
[self.tabBarController.view bringSubviewToFront:adView];
}

- (NSString *)adWhirlApplicationKey {
// return your SDK key  
return kSampleAppKey;

}
- (UIViewController *)viewControllerForPresentingModalView {

//return UIWindow.viewController;
return [(idoubs2AppDelegate *)[[UIApplication sharedApplication] delegate]     tabBarController];

}
- (void)adWhirlDidReceiveAd:(AdWhirlView *)adWhirlView {



}

最佳答案

您可能不应该向普通的 UITabBar 添加 subview ,如果您需要自定义选项卡栏的布局,您可能需要查看此处的一些替换:http://cocoacontrols.com/

关于iphone - 将 AdWhirl View 添加到 tabBarController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10356899/

相关文章:

IOs App 在模拟器上运行但在设备上崩溃(主要使用 AVFoundation)

ios - iPhone 查看照片 - 向任意方向滑动

ios - 如何在移动动画中途调整 View 大小?

android - Adwhirl SDK 始终返回 'Networkname - failure' ;适配器,调用句柄,一切正常

iPhone 推送通知信息

iphone - 警告 : control reaches end of non-void function - iPhone

ios - 在 iOS 中单击 Detail Button 从 UITableView 获取相同的记录

ios - 是否还有可能为第一代 iPad 开发? iOS 5.1.1

ios - iAds 槽 adWhirl 未完全加载