Skip to content

Bootstrap property startPageActionBarHidden not working #1471

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

Closed
NickIliev opened this issue Aug 2, 2018 · 3 comments
Closed

Bootstrap property startPageActionBarHidden not working #1471

NickIliev opened this issue Aug 2, 2018 · 3 comments
Assignees
Labels

Comments

@NickIliev
Copy link

The property startPageActionBarHidden is not working with [email protected] and [email protected]. The property as described here, use to hide the ActionBar on the landing page

Steps to reproduce:

  • Create the master-details NG app
tns create myApp --ng
  • Remove ActionBar from items.component.html and item-details.component.html
  • Add the property in main.ts
platformNativeScriptDynamic({ startPageActionBarHidden: true }).bootstrapModule(AppModule);

Result: On Android, we will have Actionbar with the title the name of the application while on iOS there will be no ActionBar at all (no matter if the property is set or not).

Test application here

Workaround:
Go to the landing page and hide the action bar though the Page instance from Di

constructor(private itemService: ItemService, private _page: Page) { 
   this._page.actionBarHidden = true;
}
@tsonevn
Copy link
Contributor

tsonevn commented Aug 2, 2018

might be related to issue NativeScript/NativeScript#6098

@NickIliev
Copy link
Author

As of version 4.x.x of tns-core-modules and NativeScript the porperty startPageActionBarHidden is no longer needed as there is no longer a Page instance created on bootstrap. Instead the first page instance is created for the default route.

So to hide the action bar on Android (on iOS we simply need to remove it from the HTML) we can get a Page instance in our default route and use actionBarHidden property.

import { isAndroid } from "platform";
import { Page } from "ui/page";

constructor(private page: Page) {
        if (isAndroid) {
            this.page.actionBarHidden = true;
        }
}

The startPageActionBarHidden will be marked for deprcication and removed from the documentation articles examples.

@NickIliev
Copy link
Author

Documentation updated via https://github.com/NativeScript/docs/pulls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants