-
-
Notifications
You must be signed in to change notification settings - Fork 241
Hiding action bar for android #353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For the initial page you can use the For subsequent page navigations you can inject the Hope that helps. |
Oh thank you |
Just for the record import { Component, OnInit } from '@angular/core';
import { Page } from "ui/page";
export class YourComponent implements OnInit {
constructor(private _page: Page) { }
ngOnInit() {
this._page.actionBarHidden = true;
}
} Is not better if the documentation is improved @vakrilov ? https://docs.nativescript.org/angular/code-samples/ui/action-bar.html |
@dianjuar You are absolutely right! |
@vakrilov it appears this is already done in this article section |
This option was working prior to Nativescript 4 but doesn't work anymore. |
@erkanarslan than you for noticing that - I will investigate the case. Meanwhile, as a workaround, you could explicitly hide the action bar on the page it is shown while directly accessing the Page instance via DI. constructor(private itemService: ItemService, private _page: Page) {
this._page.actionBarHidden = true;
} Update: confirmed as unexpected behavior and logged as a bug here |
So I've tried myself and the action bar is still showing... hmm...
Also tried
For ref my auth component html is:
Also I have it turned off in my
|
Ahh! I figured it out, so you can't have |
@vakrilov Your link http://docs.nativescript.org/angular/core-concepts/customizing-bootstrap.html#nativescript-application-options is broken. Could you fix it? |
Thanks @larssn |
@vakrilov is there any way to globally disable the action bar for all pages? I'm converting my app to use schematics (adding web support) and I'm trying to tease out the nativescript specific stuff from my components. I haven't been able tease out the page DI though since I need it to hide the action bar so I am currently stuck with nativescript specific components so I can hide the action bar. Any ideas would be appreciated, oh, and sorry for commenting on a closed issue. :-) |
FYI - just in case anyone else stumbles on this thread. I was able to solve my problem with the following simple method:
That method lives in a service with a nativescript implementation (above) and a web implementation (empty) and it gets called from ngOnInit() for the components that have to worry about hiding the action bar. That allowed met to only have one component file. |
For any1 late for this party:
|
|
I want to hide the action bar for Android
I tried actionBarHidden="true" but didn't work because I am using native script with Angular2 and I can't use the
<page>
tag due to an errorAre there any solutions to hide it for all activities?
Thanks
The text was updated successfully, but these errors were encountered: