cocos2d Whirl 集成:触摸区域被横幅遮挡
当我将whirl与cocos2d(横向)集成时,我在顶部屏幕上设置了admob横幅: 这是我的 -(void)adjustAdSize 部分:
newFrame.size.width = screenSize.width;
newFrame.origin.x = (self.adView.bounds.size.width - adSize.width)/2;
newFrame.origin.y = 0;
adView.frame = newFrame;
[UIView commitAnimations];
当连接正常时,应用程序将在底部弹出,然后向上滑动到顶部(如所示 newFrame.origin.y = 0) 但当连接速度较慢时,横幅不会显示。但是,底部区域无法感知我的触摸,直到横幅出现并滑到顶部。
我使用 http://emeene.com/2010/10/adwhirl- 的源代码cocos2d-iphone/ 有什么办法可以处理吗?或者直接让横幅出现在顶部。 (我对我的 iPad 版本使用相同的代码,横幅位于底部,横幅直接显示在那里。所以我工作得很好)
请帮助我!
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.frame = 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!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需删除动画部分并将 adView 直接放置到您想要的位置即可。像这样的事情:
您将需要删除 UIView beginAnimation 和 commitAnimation 的线条,并调整框架原点以将横幅移动到您想要的位置。
Just remove the animation part and place the adView directly to the position where you want it to be. Something like this:
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.