NativeScript: Issue NavigationButton cannot be hiden
Hello guys Im having issue, Im not been able to hide NavigationButton on IOS I working on Mac and runing emulator with Iphone also tested with Iphone 6 Seems like Navigation Button cannot be hidden
Did you verify this is a real problem by searching the [NativeScript Forum]
Yes
Which platform(s) does your issue occur on?
iOS
Please provide the following version numbers that your issue occurs with:
- CLI:3.3
Please tell us how to recreate the issue in as much detail as possible.
The best approach would be to get your code running in the NativeScript Playground and share the link with us, along with any additional details or steps to reproduce needed for examining the issue there.
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
Yes I have My Header wher is my action bar that I use across my app: header.xml
<ActionBar class="action-bar" title="" loaded="Loaded">
<NavigationButton visibility="collapse"/>
<ActionBar.actionItems>
<ActionItem tap="goToTimeplan">
<ActionItem.actionView>
<StackLayout >
<Label text="" class="action-item gray"/>
</StackLayout>
</ActionItem.actionView>
</ActionItem>
</ActionBar.actionitems>
</ActionBar>
And the use it around my pages
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:appHeader="/views/header/" loaded="loaded">
<appHeader:header />
</Page>
I have also tried with collapsed and adding class or putting it in StackLayout to Hide but Nothing works… It works that moment , but next time when I stop tns , and again run it with “tns run ios”, its visible…
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (5 by maintainers)
I had to hide the back button in iOS, and all of the above didn’t work except for @tsonevn suggestion, which led me to look for the
hidesBackButton
property in the nativescript source code, and then i figured that what works for me is:page.ios.navigationItem.hidesBackButton = true;
(tested in3.4.1
)Hi @Gamadril, You can try creating a NavigationButton via code-behind and then set up the
visibility
. For example:For further question, you can use our StackOverflow thread here.
Or another workaround I found its working is to use clearHistory like this before navigating to that page:
const topmost = require(“ui/frame”).topmost;
const navigationEntry = { moduleName: “main-page”, clearHistory: true }; topmost().navigate(navigationEntry);