cocos2d中pushScene后UIKit控件可见
我有一个包含两个 UIKit 控件的场景:UITextView。但是从这个场景中,用户有可能去另一个场景检查某些内容并返回。在pushScene之后,UIKit控件在屏幕上仍然可见,用户可以点击它们并编辑它们。
我怎样才能摆脱它们,使它们在pushScene之后不可见? 我不想删除一个场景并添加另一个场景,因为我想保留其中发生的任何事情,这也意味着在用户执行 popScene 后我无法释放控件并创建新的控件。
I've got a scene with two UIKit controls: UITextView. But from this scene, user has possibility to go to another scene to check something and come back. After pushScene the UIKit controls are still visible on screen and user can tap on them and edit them.
How can I get rid of them so that they are not visible after pushScene?
I don't want to remove one scene and add another, as I want to maintain whatever happened in it, this also means I cannot release the controls and create new ones after user does popScene.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
调用pushScene时,将UITextViews设置为隐藏:
弹出推送的场景后,只需再次取消隐藏文本字段即可。隐藏时,UIView 不接收输入事件,但它们保留在视图层次结构中。
When calling pushScene, set the UITextViews as hidden:
After popping the pushed scene simply unhide the text fields again. While hidden, UIViews don't receive input events but they remain in the view hierarchy.