Google의 지침에 따라 kobold2d v2.1.0을 사용하고 AdMob 조정 SDK를 프로젝트에 추가했습니다.AdView를 탭하면 CCMenuItem가 응답합니다.
AdViewController
을 작성하여 rootViewController.view
에 추가했습니다.
AdViewController.m :
-(void)viewDidLoad
{
[super viewDidLoad];
// Initialize the banner at the bottom of the screen.
CGPoint origin = CGPointMake(0.0,
self.view.frame.size.height -
CGSizeFromGADAdSize(kGADAdSizeBanner).height);
// Use predefined GADAdSize constants to define the GADBannerView.
self.adBanner = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner
origin:origin];
// before compiling.
self.adBanner.adUnitID = AD_UNIT_ID;
self.adBanner.delegate = self;
[self.adBanner setRootViewController:self];
[self.view addSubview:self.adBanner];
self.adBanner.center =
CGPointMake(self.view.center.x, self.adBanner.center.y);
[self.adBanner loadRequest:[self createRequest]];
}
AppDelegete.m
-(void) initializationComplete
{
adViewController = [[AdViewController alloc] init];
[self.rootViewController.view addSubview:adViewController.view];
}
-(id) alternateView
{
// we want to be a dummy view the self.view to which we add the glView plus all other UIKit views
KKAppDelegate* appDelegate = (KKAppDelegate*)[UIApplication sharedApplication].delegate;
// add a dummy UIView to the view controller, which in turn will have the glView and later other UIKit views added to it
CGRect bounds = [appDelegate.window bounds];
UIView* dummyView = [[UIView alloc] initWithFrame:bounds];
[dummyView addSubview:[CCDirector sharedDirector].view];
return dummyView;
}
광고가 원격으로 나는 CCMenuItem
을 누릅니다 것처럼 CCMenuItem
을 누르면 위치, 표시되기 전에 나는 광고 영역을 누릅니다
나는이 this question에 관한 생각이
보면,하지만 난 그것을 해결하는 방법을 알고하지 마십시오.
CCMenuItem
이 원격 위치의 탭에 응답하는 것을 방지하는 방법을 알려주십시오.
영어가 능숙하지 않아서 죄송합니다.