开发者

cocos2d whirl integration: touch area blocked by banner

开发者 https://www.devze.com 2023-04-13 01:22 出处:网络
when i integrate whirl with cocos2d (landscape), i set the admob banner on top screen: here is my part of my -(void)adjustAdSize:

when i integrate whirl with cocos2d (landscape), i set the admob banner on top screen: here is my part of my -(void)adjustAdSize:

newFrame.size.width = screenSize.width;
newFrame.origin.x = (self.adView.bounds.size.width - adSize.width)/2;
newFrame.origin.y = 0;
adView.f开发者_开发知识库rame = newFrame;
[UIView commitAnimations];

when the connection is fine, the app will pop out at the bottom, then slide up to the top (as indicated newFrame.origin.y = 0) but when the connection is slow, the banner didn't show up. however, the bottom area can not sense my touch, until the banner shows up and slide to the top.

I use the source code from http://emeene.com/2010/10/adwhirl-cocos2d-iphone/ is there any way to deal with it? or just let the banner appear on the top directly. (i use the same code for my iPad version, where the banner is on bottom, the banner just directly shows there. so i works perfectly well)

please help me!!!


Just remove the animation part and place the adView directly to the position where you want it to be. Something like this:

newFrame.size.width = screenSize.width;
newFrame.origin.x = (self.adView.bounds.size.width - adSize.width)/2;
newFrame.origin.y = 25;
adView.frame = newFrame;

You will want to remove the lines with UIView beginAnimation and commitAnimation and tweak the frame origin to move the banner to where you want it to be.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号