Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
718 views
in Technique[技术] by (71.8m points)

navigation - NativeScript: hide ButtomNavigation after navigating to different page

I am trying to implement a ButtomNavigation in my app, using NativeScript. as I understood, the normal behaviour is that the ButtomNavigation stays all the time at the buttom, even if you navigate again to lower hierarchy pages.

i.e. you can get a sense of the expected behaviour here: howButtomNavigation behaves

but I dont want the expected behaviour. I want to hide the ButtomNavigation immediately after navigating within one of its pages to a lower hierarchy page (nested page), and I want it to be shown again once the user gets back to one of the main pages (destinations)

so I have looked at nativeScript play ground link for ButtomNavigation playground, to look for inspiration and I have found that they using Frames within each one of the 'tabs' and they use each tab specific frame to navigate further:

  function onTap(args) {
      const button = args.object;
      const page = button.page;
      page.frame.navigate("item-page");
  }

since I want a different behaviour, I tried navigating with an higher level frame and to my surprise the ButtomNavigation disappeared - as I wished, and it is showed again only when the user is back to one of the main pages.

but to be honest I dont understand why any of this happening:

  1. why in order to achieve the normal behaviour (keep the ButtomNavigation at the buttom) one have to use the frame as it shown in the native script playground.
  2. why on using a different frame (higher level one) it behaves differently - i.e disappears on navigating.

hope someone can help (:

question from:https://stackoverflow.com/questions/65902024/nativescript-hide-buttomnavigation-after-navigating-to-different-page

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...