MrDatabase
MrDatabase

Reputation: 44425

How do I remove the UINavigationBar from a UIViewController?

I'm experimenting with the NavBar sample project for iPhone. When I tap on one of the rows in the table in the default view a new view slides in (so far so good). I want to remove the UINavigationBar bar at the top of the new view that slides in. How can I do this?

EDIT: I meant "UINavigationBar". Thanks to everyone who responded!

Upvotes: 5

Views: 7939

Answers (3)

user31517
user31517

Reputation: 21

[[UIApplication sharedApplication]setHidesStatusBar:YES];

Upvotes: 2

Ben Gottlieb
Ben Gottlieb

Reputation: 85522

Are you referring to the status bar (where the time and battery status are shown) or the UINavigationBar (where the title and Back buttons are)?

  • To hide the status bar, use [UIApplication sharedApplication].statusBarHidden = YES; in your -applicationDidFinishLaunching: method.

  • To hide the UINavigationBar, you'll want to use the navigationBarHidden property of your UINavigationController.

Upvotes: 16

gilm
gilm

Reputation: 8050

You can either hide it programmatically by called setHidesStatusBar on your UIApplication (sharedApplication), or you can set it in the plist. Check the CrashLanding's plist.

Upvotes: 2

Related Questions