This is a migrated thread and some comments may be shown as answers.

Can't hide iOS NavBar in v0.10

2 Answers 42 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ian
Top achievements
Rank 1
Ian asked on 06 May 2015, 08:00 PM

Hi. In previous versions of Nativescript, I was able to hide the iOS navigation bar using the following code in the pageLoaded event:

  if (frames.topmost().ios) {
      frames.topmost().ios.showNavigationBar = false;
  }

This no longer seems to work in v0.10. I also tried the method suggested by Burke Holland in his Customize the iOS Navigation Bar / Status Bar with NativeScript article and that doesn't seem to work either.

Is there a different way to hide the navbar in v0.10 or is it now always displayed?

Regards, Ian 

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 07 May 2015, 07:32 AM
Hi Ian,

We have added a new property on the ios instance "navBarVisibility" so it should be:
var enums = require("ui/enums");
 
//...
if (frames.topmost().ios) {
       frames.topmost().ios.navBarVisibility = enums.NavigationBarVisibility.never;
}

The default value is auto which means that navigationBar is visible once you navigate to a page or if you have MenuItems set in the optionsMenu property.


Regards,
Hristo
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Ian
Top achievements
Rank 1
answered on 07 May 2015, 01:33 PM

Hi Hristo,

That works fine - thanks for the quick reply. I noticed that the new method seems to act as a 'global' option and only needs to be used once in the initial (main) module and it then applies throughout the entire application which is good.

Best regards, Ian

Tags
General Discussions
Asked by
Ian
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Ian
Top achievements
Rank 1
Share this question
or