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

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;

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

Add this(with spaces) to your info.plist:
View controller-based status bar appearance -> Value: NO

Related

My iOS app Screen is not auto sizing in iOS 5 dimension

The Screen UI is developed for 3:2, but when I run the app in iOS Simulator for iphone 5 and above, I see there is a white patch below in the bottom of the screen. The rest of the screens are appearing correctly.
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[self startup];
[window addSubview:loginViewController.view];
//For Eula
NSDictionary *eulaDict = [EULAController getEULADictionary];
if (eulaDict == nil || [ self checkForVersionChange] == TRUE) {
eulaController = [[EULAController alloc] initWithNibName:#"eula"bundle:[NSBundle mainBundle]];
//temp fix as for some reason this is showing up 20 pixels shifted upwards. if this works in your scenario then remove this adjustment
CGRect frame1 = CGRectMake(0,20,320,460);
[eulaController.view setFrame:frame1];
[window addSubview:eulaController.view];
}
[self updateVersionAndBuild];
[window makeKeyAndVisible];
}
Not sure, why its not fitting the entire screen. I didn enable athe AutoLayout option but it didnt help, as during the launch of the app, it stops for iphone 5/6.
Thanks in advance !
I guess you are missing the Default-568h#2x.png default launch image...
If so, just add one to your project and it will work.
You've hardcoded the frame to iPhone 4 size:
CGRect frame1 = CGRectMake(0,20,320,460);
You've said your using autoLayout. I'd remove this and use autoLayout constraints instead and it will scale.

UINavigationController in UITabBarController: NavigationItems disappear in iOS7

I have an iPad application compatible with iOS 5.1 or higher. I'm updating the app for iOS 7.
I have this problem: I have a UINavigationController inside a UITabBarController. I want to add rightBarButtonItems. With iOS 6 or lower are seen, but with iOS 7 no. What I'm wrong?
PS: I'm forced to make app compatible with iOS 5.1 because there are some customers who are still using the first generation of iPad, so I can't use AutoLayout. I'm XIB because the project is a pretty old and I haven't to rewrite code.
Thank you!!
edit for Nikos M.
self.navigationItem.rightBarButtonItems = #[...];
Image: http://i.stack.imgur.com/RB3Rc.png
Edit 2:
I had tried to add a custom view on navigation bar:
//I added this line otherwise I not see the Navigation Bar!!
[self.navigationController.navigationBar setFrame:CGRectMake(0, 0, 320, 132)];
[self.navigationController.navigationBar addSubview:[self addTableHeader]];
and this is the result!!
http://i.stack.imgur.com/aksqb.png
This is working for me in iOS 7. Try this.
self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:[[UIBarButtonItem alloc]initWithTitle:#"ONE" style:UIBarButtonItemStylePlain target:self action:nil], nil];

Navigation bar is pushed down in iOS7

I am compiling my app with iOS 6.1 SDK and deploying in a iOS7 device. The app's device is set for iPhone only.
I have a view controller that I add to a navigation controller.
self.window.rootViewController = [[UINavigationController alloc]
initWithRootViewController:
[[MyViewController alloc] init]];
When I deploy the app in iPad Mini running iOS 7, there is a strange gap shown at the top.
If I set the app's device to Universal, then the gap goes away. Is there any explanation for this? Thanks.
The few changes which you should take care of in iOS 7:-
1) Navigation Bar of iOS 7 is of dimension :- 320 X 64 while iOS 6 it is :- 320 X 44.
2) Navigation Bar Translucent Property is YES by default in iOS 7 so set it to NO, as status bar is also included in iOS 7.
Take care of these things and it would go fine.
// Sample Code of setting the navigation controller and image programatically in iOS 7
self.navigationController.navigationBar.translucent=NO;
[self.navigationController setNavigationBarHidden:NO animated:YES];
UIImage *backgrdNavImage=[UIImage imageNamed:#"abc.jpg"];
[self.navigationController.navigationBar setBackgroundImage:backgrdNavImage forBarMetrics:UIBarMetricsDefault];

IOS 6 navigationController navigationbar

I just updated my phone to IOS 6 but I have some issue regarding adding UIImageView on the UINavigationController navigationbar. This is my code
UIImage *logoImage = [UIImage imageNamed:#"navigationbar.png"];
UIImageView *logoImageView = [[UIImageView alloc] initWithImage:logoImage];
UINavigationBar *navBar = self.navigationController.navigationBar;
[navBar addSubview:logoImageView];
[logoImageView release];
This will add logo on navigationbar, it works great on the lower version of IOS 6. But on IOS 6 the logo shown but the back button was behind the logo so back button is not shown.
I don't want to override the UINavigationBar drawrect since I also have UINavigatioBar somewhere on the code for popup.
Any suggestions?
I think you don't need a UIImageView in IOS 6.
You can just put a background image in the UINavigationBar (for example in AppDelegate) like this:
[[UINavigationBar appearance] setBackgroundImage :[UIImage imageNamed:#"navigationbar"]];
Found a good site which explains some new user interface customisation in IOS 6:
click here

iphone sdk - segmentedcontrol.tintcolor not working in OS3

In my app I have a uisegmentedcontrol in the navigation bar, as the right button item.
the code:
segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
segmentedControl.tintColor = [UIColor colorWithRed:0.70 green:0.171 blue:0.1 alpha:1.0];
works in OS2 but not OS3...?
ade.
p.s. my base sdk is 3.0
Ok,
I had to do two things:
1) For views that always had the segmentedcontrol I had to set the tint color after adding the segmentedcontrol to the rightbarbuttonitem and move the code to viewDidAppear (I had it in ViewWillAppear)
2) For views that don't always have the segmentedcontrol it looked ugly using viewDidAppear as it sometimes was showing the segmentedcontrol and then removing it (when it shouldn't be shown at all). So I had to here use viewWillAppear but also set the item to nil in viewDidDisappear
ade.