Reputation: 479
I want to hide UINavigation Bar and only show Status bar for the Rootview controller. this.NavigationController.SetNavigationBarHidden(true, true);
hides both. now it look like this .
Upvotes: 1
Views: 2145
Reputation: 2258
So, your screenshot shows the Status Bar and didn't show the Navigation Bar. The code works fine as you expected.
For more details on how to hide/show Status Bar and Navigation Bar, please see the below section:
To hide/show Status Bar you need to add this setting in your info.plist file:
<key>UIViewControllerBasedStatusBarAppearance</key>
<false />
Then add the code in your ViewController:
UIApplication.SharedApplication.SetStatusBarHidden(true/false,true);
To hide/show the Navigation Bar, you just need to add the codes in ViewWillAppear
:
this.NavigationController.SetNavigationBarHidden(true/false, true);
Upvotes: 2
Reputation: 734
First check that in the file info.plist
Verify that Hide status bar is not checked. If you want to show the status bar.
and let me know if solve your problem.
Upvotes: 0
Reputation: 130
Sorry, I can't comment because I don't have enough reputation.
From your attached picture & question to hide UINavigationBar & only show Status Bar, it looks like it is correct & your code is correct too.
Attached is answer maybe you looking for: How to hide Navigation Controller in Root View?
Upvotes: 0