问题
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:

回答1:
Basically there are two underlying problems.
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)
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:
- Set a CCMenu position explicitly instead of using the implicit
positioning (e.g:
menu.position = ccp(self.contentSize.width/2, self.contentSize.height/2);
) - Set View controller-based status bar appearance -> NO in your Info.plist if you don't want to show the status bar anyway
来源:https://stackoverflow.com/questions/19438939/ccmenu-misplaced-under-ios-7