Cocos2d和UIScrollView

编程入门 行业动态 更新时间:2024-10-26 06:39:03
本文介绍了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):

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

本文发布于:2023-06-05 01:12:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/508805.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Cocos2d   UIScrollView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!