我正在开发一个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):
在右侧,分隔层(菜单层)中包含一个垂直可滚动菜单,菜单本身又包含在主场景的层中.在左侧,主场景的图层中包含一个后退按钮.我正在尝试利用此链接.但是,尽管我可以看到UIScrollView正常运行,但我仍在尝试一些问题:
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
发布评论