我正在尝试将新对象ADBannerView集成到我的Cocos2d游戏中,但当游戏处于横向模式时,屏幕左侧的垂直横幅将显示在屏幕上。这是我的代码:如何将AdBannerView集成到Cocos2d中
UIViewController *controller = [[UIViewController alloc] init];
controller.view.frame = CGRectMake(0,0,480,32);
//From the official iAd programming guide
ADBannerView *adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifier480x32];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier480x32;
[controller.view addSubview:adView];
//Then I add the adView to the openglview of cocos2d
[[Director sharedDirector] openGLView] addSubview:controller.view];
我想横幅出现在屏幕的顶部水平(横向模式)。
感谢您的支持!