问题描述
因此,当前我会在应用程序的开头进行初始调用以隐藏状态栏,并将动作栏设置为隐藏在我所有组件的构造函数中,但是当我在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应用程序bu 提供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中的导航使状态栏和操作栏保持隐藏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!