cocos2d Whirl 集成:触摸区域被横幅遮挡

发布于 2024-12-10 06:26:12 字数 632 浏览 0 评论 0原文

当我将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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吹泡泡o 2024-12-17 06:26:12

只需删除动画部分并将 adView 直接放置到您想要的位置即可。像这样的事情:

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

您将需要删除 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:

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文