我应该如何通过 Nativescript 中的导航隐藏状态栏和操作栏? [英] How should I keep the status bar and actionbar hidden through navigation in Nativescript?

查看:32
本文介绍了我应该如何通过 Nativescript 中的导航隐藏状态栏和操作栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以目前我在应用程序的开头进行了初始调用以隐藏状态栏,并将操作栏设置为隐藏在我所有组件的构造函数中,但是当我在 android 中打开键盘时,状态栏显示备份并且在键盘隐藏时不会隐藏.我应该如何处理这个问题,特别是考虑到 nativescript 没有键盘打开和关闭事件?我只需要在键盘关闭后保持隐藏状态栏(最好总是).

so currently I make an initial call to hide the status bar at the beginning of the app and also set the actionbar to hidden in the constructor of all my components, yet when I open the keyboard in android the status bar shows back up and doens't hide when the keyboard hides. How should I deal with this, especially given the fact that nativescript has no events for on keyboard open and close? I just need to maintain the status bar hidden after the keyboard closes (preferable always).

更具体地说,我在我的项目中使用了 Nativescript 3.0、Typescript 和 Angular 2.

To be more specific I'm using Nativescript 3.0, Typescript, and Angular 2 in my project.

推荐答案

您可以选择在没有操作栏的情况下引导 Angular 应用程序 提供 startPageAcrionBarHidden 选项

You have the option to bootstrap the Angular application with no action bar bu providing startPageAcrionBarHidden option

platformNativeScriptDynamic({startPageActionBarHidden: true});

对于特定页面,您可以使用 actionBarHidden 页面上的属性

For specific page you can use actionBarHidden property on page

例如

import { Page } from "ui/page";

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

这篇关于我应该如何通过 Nativescript 中的导航隐藏状态栏和操作栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆