Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide navigation bar in iOS 7 specifically for cocos2D?

My app is made with cocos2D 2.1, and I am using Xcode 5. After compiling, the UINavigationBar appears in my app on the top.

How can it be hidden? I have tried the other generic iOS 7 codes that seem to work for native iOS 7 Apps:

// None of the following works
navController_ = [[UINavigationController alloc] initWithRootViewController:director_];
navController_.navigationBarHidden = YES;
navController_.edgesForExtendedLayout = UIRectEdgeNone;
[navController_.navigationBar setTranslucent:NO];

if ([[CCDirector sharedDirector] respondsToSelector:@selector(edgesForExtendedLayout)])
    [CCDirector sharedDirector].edgesForExtendedLayout = UIRectEdgeNone;
like image 606
Simon Avatar asked Sep 26 '13 05:09

Simon


1 Answers

Set UIViewControllerBasedStatusBarAppearance to NO in the project's Info.plist.

like image 148
Mark Avatar answered Nov 13 '22 04:11

Mark