Cocos2d和UIScrollView [英] Cocos2d and UIScrollView

查看:57
本文介绍了Cocos2d和UIScrollView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个iPhone cocos2d应用,其场景类似于下图所示(希望您能看到):

I am developing an IPhone cocos2d app with a scene like the the one depicted in the following image (I hope you can see that):

在右侧,分隔层(菜单层)中包含一个垂直可滚动菜单,菜单本身又包含在主场景的层中.在左侧,主场景的图层中包含一个后退按钮.我正在尝试利用

On the right there is a vertically scrollable menu contained in a separated layer (menulayer) which is itself contained in the main scene's layer. On the left there is a back button contained in the main scene's layer. I am trying to exploit the UIScrollView as described in this link. However, despite I can see the UIScrollView working I am experimenting some problems:

1)菜单层实际滚动时,菜单似乎没有滚动.实际上,当按下菜单项8时,菜单项4被选中,当我按下菜单项7时,菜单项3被选中,依此类推.

1) while the menulayer actually scrolls it seems the menu does not. In fact when a press the menu item 8 the menu item 4 is selected, when I press the menu item 7 the menu item 3 is selected and so on.

2)后退按钮仅在菜单层位于其第一位置时有效

2) the back button only works when the menulayer is at its first position

您对我应该如何解决它有任何想法吗?

Do you have any idea of how shall I do to fix it?

推荐答案

您需要检查选择器.从适当的控件调用选择器.请仔细检查.您的问题显示菜单项第8个选择器与第4个选择器绑定.您的代码中存在选择器的某些绑定错误,因此请正确检查它们.

You need to check you selectors. calls selectors from proper controls. check it carefully.Your problem shows your menu item 8 th selector bind with 4th same for others. some mis binding of selectors is present in your code so check them properly.

这篇关于Cocos2d和UIScrollView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆