CCMenu错位在iOS 7下 [英] CCMenu misplaced under iOS 7

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

问题描述

在iOS 6下,我的所有CCMenus出现在屏幕上默认中心,如果我没有分配一个明确的位置。 在iOS 7下,菜单位于屏幕外



我必须在iOS 7下指定显式位置吗?



iOS 6:



>



iOS 7:



解决方案

基本上有

如果您在iOS 6下隐藏了状态栏,那么这将不适用于iOS 7向您的 Info.plist 查看基于控制器的状态栏外观 - >否


  • 由于Cocos2D中的错误, ,如果您的状态栏是可见的。


  • 您必须使用不同的选项解决此问题


    1. 显式设置CCMenu位置,而不是使用隐式
      定位(例如: menu.position = ccp(self.contentSize。 width / 2,self.contentSize.height / 2);

    2. 设置查看基于控制器的状态栏外观 - > NO 。 t仍要显示状态栏


    Under iOS 6 all my CCMenus appeared centered on the screen by default, if I did not assign an explicit position. Under iOS 7 the menus are positioned off screen.

    Do I have to assign an explicit position under iOS 7?

    iOS 6:

    iOS 7:

    解决方案

    Basically there are two underlying problems.

    1. If you have hidden your status bar under iOS 6, this will not work for iOS 7 without adding an additional value to your Info.plist (View controller-based status bar appearance -> NO)

    2. Due to a bug in Cocos2D your screen size will be calculated wrong, if your status bar is visible.

    You have to different options to solve this problem:

    1. Set a CCMenu position explicitly instead of using the implicit positioning (e.g: menu.position = ccp(self.contentSize.width/2, self.contentSize.height/2);)
    2. Set View controller-based status bar appearance -> NO in your Info.plist if you don't want to show the status bar anyway

    这篇关于CCMenu错位在iOS 7下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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