Nativescript 更改状态栏字体颜色
仍然可以使用angular2/nativescript更改特定页面上的状态栏颜色吗 我试着从文档中使用这种方法,但它不起作用Nativescript 更改状态栏字体颜色,nativescript,angular2-nativescript,angular-nativescript,Nativescript,Angular2 Nativescript,Angular Nativescript,仍然可以使用angular2/nativescript更改特定页面上的状态栏颜色吗 我试着从文档中使用这种方法,但它不起作用 import { topmost } from "tns-core-modules/ui/frame"; if (topmost().ios) { var navigationBar = topmost().ios.controller.navigationBar; // 0: default // 1: light navigationBar.
import { topmost } from "tns-core-modules/ui/frame";
if (topmost().ios) {
var navigationBar = topmost().ios.controller.navigationBar;
// 0: default
// 1: light
navigationBar.barStyle = 1;
}
游乐场示例如下:
注:我需要有黑色的第一页和第二页上的白色状态栏。有可能吗?您必须在
info.plist中将UIViewControllerBasedStatusBarAppearance
键设置为true
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
UIViewControllerBasedStatusBarAppearance
您必须在info.plist中将UIViewControllerBasedStatusBarAppearance
键设置为true
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
UIViewControllerBasedStatusBarAppearance
您可以使用下一个处理程序将加载事件设置为ActionBar
:
onActionBarLoaded导出函数(args:EventData){
const actionBar=。您可以使用下一个处理程序将加载事件设置为actionBar
:
onActionBarLoaded导出函数(args:EventData){
const actionBar=。它仍然是黑色的。它仍然是黑色的。但是如果我想隐藏actionBar,该怎么办?在iOS中如果你隐藏actionBar,那么StatusBar会丢失它的背景。你读过吗?但是如果我想隐藏actionBar,那么在iOS中如果你隐藏actionBar,那么StatusBar会丢失它的背景。你读过吗?