【发布时间】:2010-06-10 17:37:03
【问题描述】:
我正在尝试将新对象 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];
我希望横幅以水平(横向模式)显示在屏幕顶部。
感谢您的支持!
【问题讨论】:
标签: objective-c cocoa cocos2d-iphone