我正在嘗試將新對象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];
我想橫幅出現在屏幕的頂部水平(橫向模式)。
感謝您的支持!