Can't hide iOS NavBar in v0.10

Thread is closed for posting
3 posts, 1 answers
  1. Ian
    Ian avatar
    129 posts
    Member since:
    Jun 2009

    Posted 06 May 2015 Link to this post

    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. Answer
    Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 07 May 2015 Link to this post

    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.

     
  3. Ian
    Ian avatar
    129 posts
    Member since:
    Jun 2009

    Posted 07 May 2015 in reply to Hristo Link to this post

    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

Back to Top